64-bit / 128-bit data element type for array?

akineko akineko at gmail.com
Mon Dec 22 16:13:08 EST 2008


Hello,

bearophile and  Robert, thank you for your prompt response.
I will try NumPy (this is a good execuse to learn and to use a new
package).

> I haven't seen uint128 in the wild, though.

Of course, not many applications require uinit128 as a scalar value.
I may need to deal with 128-bit data as it is now not uncommon to have
128-bit data bus (or even 256-bit wide and beyond) in ASICs
(microchip) design. Unfortunately, some designs use big-endian and
others use little-endian ...

Thank you and Happy Holidays!
Aki Niimura

On Dec 22, 11:26 am, Robert Kern <robert.k... at gmail.com> wrote:
> akineko wrote:
> > Hello everyone,
>
> > I need to handle binary files that contain 64-bit (or 128-bit in the
> > furture) unsigned int data.
> > Python's array seems not supporting unsigned int type beyond 32-bit
> > ('L').
> > I would like to use Python array as I need to make my program work on
> > both big-endian machines as well as on little-endian machines.
>
> > What is the best way to deal with 64-bit / 128-bit data elements in
> > Python (must support byteswap())?
> > (must be machine-independent)
>
> You might give numpy a try. We support uint64 data even on 32-bit machines
> provided that your C compiler does. I haven't seen uint128 in the wild, though.
>
> http://numpy.scipy.org/
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>   that is made terrible by our own mad attempt to interpret it as though it had
>   an underlying truth."
>    -- Umberto Eco




More information about the Python-list mailing list