Hacker News new | ask | show | jobs
by account42 13 days ago
I don't like formats that look like text buy may actually contain binary data - that's only going to tempt implementations that will choke when the string actually contains arbitrary data. Would be safer to encode the length and/or separator as something more obviously binary, which will also make the thing easier to parse in low-level implementations.
1 comments

For this I made a tlv format, where string is encoded in byte prefixed chunks with length between 0 and 222 for final chunk and between 223 and 255 for intermediate chunks.