0.9.0 • Published 3 years ago

@diablo2/huffman v0.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@diablo2/huffman

Huffman packet encoding for diablo2 network packets

import {Huffman} from '@diablo2/huffman';

/** get total number of bytes needed to decompress  (Including the header)*/
Huffman.getPacketSize([6, 122, 4, 100, 187, 188] ) // 6

/** Get the offset to the first data byte */
Huffman.getHeaderSize([6, 122, 4, 100, 187, 188]) // 1

/** Decompress the buffer and return a new buffer */
Huffman.decompress([6, 122, 4, 100, 187, 188])
/**
[
  1, 0, 4, 8, 48,
  0, 1, 1, 0
]
*/
0.9.0

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.1.0

4 years ago