Skip to content

v1.1

Choose a tag to compare

@EmK530 EmK530 released this 13 Dec 13:43
· 88 commits to main since this release
08abf93
  • Added NetShrink header to buffers
    This increases all buffers by 4 bytes in size, but it's for safety because of this next feature.

  • Added ability to encrypt (XOR shift) buffers
    Uses a number as a key and randomly generates XOR shifts for each byte.
    To use this add a number as the last argument in Encode, or third argument in Decode.

-- Encryption
local buf = NetShrink.Encode(
    NetShrink.String("Hello World!",1,5),
    12345
)

-- Decryption
local dec = NetShrink.Decode(buf,true,12345)
print(dec[1]) -- Prints "Hello World!"

Using a key when decoding an unencrypted buffer or no key for an encrypted buffer, leads to an error:
[NetShrink] Cannot decode invalid buffer, expected 'NShd' header but got '6Pz4'

Full Changelog: v1.0...v1.1