fix: ensure correct encoding and decoding when data length is greater than 256 (#32)