Ideal Field Type For Fixed Width Binary Data

时光怂恿深爱的人放手 提交于 2019-12-04 06:11:35

问题


If I want to store binary data (hash values) and they're always 128bytes long, what field type should I use? BLOBs are nice, but they aren't fixed width (and result in dynamic tables).. CHAR requires a charset.


回答1:


You can use BINARY, so BINARY(128).

Note that if you're storing character data, then the standard character set of the operating system is used to convert the character to it's byte value, so you'd have to take any cross-platform issues into consideration.



来源:https://stackoverflow.com/questions/2028949/ideal-field-type-for-fixed-width-binary-data

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