kutsurak / python-bitstring

Automatically exported from code.google.com/p/python-bitstring
0 stars 0 forks source link

Multiplicative factors and groupings for tokens #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For example:

a = pack('8*uint:16', range(8))

The '*' isn't strictly necessary but it makes the intent a fair bit
clearer. Brackets could also be employed:

b = BitString('3*(bit:1, uint:7)', '1', 34, '0', 12, '1', 33

and finally with a variable factor:

c = b.unpack('n*(bin:1, uint:7)', n=3)

Original issue reported on code.google.com by python.bitstring@googlemail.com on 30 Aug 2009 at 7:55

GoogleCodeExporter commented 9 years ago

Original comment by python.bitstring@googlemail.com on 16 Sep 2009 at 9:59

GoogleCodeExporter commented 9 years ago

Original comment by python.bitstring@googlemail.com on 17 Dec 2009 at 5:01

GoogleCodeExporter commented 9 years ago
Done in revision 643 and others. Currently can't use a variable factor though.

Original comment by python.bitstring@googlemail.com on 1 Feb 2010 at 6:50