Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Strings are serialized as (type code) (uint16 length) (string contents) (null byte).

In the API, the string length is determined the normal way in each language: strlen() in C, len() in Python. The trailing NUL allows the C decoder to return just a pointer to the string (without allocating).

So internal null bytes and strings longer than 0xFFFF are functionally prohibited.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: