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

Been burned by this myself, because while the person that created the ID knew it was a string, the person using it down the line thought it looked like a number and treated it like one.

My advice is to store those ID's with a leading "$" character or something similar. Removes the temptation to treat them like numbers.




Or convert them to hex before sending to client. And you can convert them back to decimal on the server side.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: