2.1.7 • Published 2 months ago

@remy/unpack v2.1.7

Weekly downloads
4
License
MIT
Repository
github
Last release
2 months ago

unpack (and pack)

JavaScript module for unpacking and packing based loosely around the Perl packing syntax.

Working demo can be found at unpack.isthe.link.

Lookup table for unpacking:

  • a A string with arbitrary binary data, will be null padded.
  • A text (ASCII) string, will be space padded.
  • b A bit string (ascending bit order inside each byte).
  • c A signed char (8-bit) value.
  • C An unsigned char (octet) value.
  • s A signed short (16-bit) value.
  • S An unsigned short value.
  • i A signed integer (32-bit) value.
  • I A unsigned integer value.
  • l A signed long (64-bit) value.
  • L An unsigned long value.
  • n An unsigned short (16-bit) in "network" (big-endian) order.
  • N An unsigned long (32-bit) in "network" (big-endian) order.
  • f A single-precision float in native format.
  • d A double-precision float in native format.
  • x A null byte (a.k.a ASCII NUL, "\000", chr(0))

Each type can also include a number, such as A5 will unpack to a 5 byte ascii string.

Unless otherwise stated, endianness can be set to little by using <, such as: <I I L unpacks using little endian 2 32bit unsigned ints and 1 64 bit long.

2.1.7

2 months ago

2.1.4

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago