Packing and unpacking bitvectors

Discussion in 'Python' started by Victor S. Miller, Oct 9, 2003.

  1. I'm sure that this has been asked and answered before, but about 1/2
    hour of searching hasn't turned up anything.

    I have external data that requires the packing and unpacking of
    long vectors of bits. It's not hard to do this "by hand" in Python,
    but surely there must be some more efficient package that does this.
    The package struct doesn't seem to be applicable, since the shortest
    unit that it deals with is a byte. Given that various odd-sized
    bitfields (as well as just straight bitvectors) are common enough, I
    was surprised not find anything.

    Can anyone help?

    Victor
     
    Victor S. Miller, Oct 9, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ram
    Replies:
    7
    Views:
    463
    Dennis Lee Bieber
    Nov 15, 2006
  2. imageguy
    Replies:
    7
    Views:
    361
    John Machin
    Jan 13, 2009
  3. Daniel Platz
    Replies:
    2
    Views:
    1,733
    Neal Becker
    Jul 22, 2009
  4. Eelco
    Replies:
    121
    Views:
    2,290
    Eelco
    Jan 3, 2012
  5. Lucas L.
    Replies:
    12
    Views:
    350
    ara.t.howard
    Jun 16, 2008
  6. Aaron D. Gifford
    Replies:
    3
    Views:
    280
    Aaron D. Gifford
    Apr 7, 2011
  7. Julie

    Packing/unpacking

    Julie, Sep 22, 2003, in forum: Perl Misc
    Replies:
    2
    Views:
    179
    Chris Mattern
    Sep 22, 2003
  8. Shashank R Khanvilkar

    Packing/Unpacking bit fields from a byte.

    Shashank R Khanvilkar, Sep 25, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    696
    Anno Siegel
    Sep 26, 2005
Loading...