Ideal Field Type For Fixed Width Binary Data
If I want to store binary data (hash values) and they're always 128bytes long, what field type should I use? BLOB
s 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.
精彩评论