What is the smallest way to store a UUID that is human readable?

吃可爱长大的小学妹 提交于 2019-12-22 10:29:57

问题


What is the smallest way to store a UUID that is human readable and widely database compatible?

I am thinking a char array of some sort using hex values?


回答1:


As common approach, i think that encoding the binary data (16 bytes) as Base64 could be what you want.




回答2:


Use Base-85 encoding to store the UUID as 20 US-ASCII characters.




回答3:


You might find the latest podcast relevant:

http://itc.conversationsnetwork.org/shows/detail4087.html

Database-wide unique-yet-simple identifiers in SQL Server




回答4:


You want Base64 if it is going to be in any kind of computer representation. Base85 if you can figure out a way around putting it in a URL. See: http://en.wikipedia.org/wiki/Base64 and http://en.wikipedia.org/wiki/Ascii85



来源:https://stackoverflow.com/questions/772325/what-is-the-smallest-way-to-store-a-uuid-that-is-human-readable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!