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

I think it's a fair question, because yes you should store them as numbers, but they are still often sent in text formats and urls. Wanting a shorter representation is reasonable.

The easiest is probably to just base64 the binary representation of the 128 bit number, which results in a 128/6=22 character string, which is a bit smaller.

If glyph-length and not byte-length is more important you could go even smaller but I'm less sure if that's a good idea.



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

Search: