Basic options for LZW decoding.
By default, least-significant bit ordering is used. You can change the encoded byte ordering of the decoder with the options parameter. To use least-significant bit ordering:
options
const bytes = Lzw.unpack(encodedBytes, { order: 'msb' }); Copy
const bytes = Lzw.unpack(encodedBytes, { order: 'msb' });
The default code-width it uses is 8, this can also be adjusted. To use an ASCII 7-bit code width:
8
const bytes = Lzw.unpack(encodedBytes, { literalWidth: 7 }); Copy
const bytes = Lzw.unpack(encodedBytes, { literalWidth: 7 });
Optional
Specify an explicit initial code-width for the LZW algorithm.
8 Copy
Select the packing bit-ordering.
'lsb' Copy
'lsb'
Basic options for LZW decoding.
Example: Changing the bit packing ordering.
By default, least-significant bit ordering is used. You can change the encoded byte ordering of the decoder with the
options
parameter. To use least-significant bit ordering:Example: Using a different code-width for decoding
The default code-width it uses is
8
, this can also be adjusted. To use an ASCII 7-bit code width: