开发者

Ideal Field Type For Fixed Width Binary Data

开发者 https://www.devze.com 2022-12-15 17:10 出处:网络
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

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 ch开发者_开发知识库arset.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消