-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bryan Tong Minh wrote:
On 6/5/07, christoph.huesler(a)css.ch
<christoph.huesler(a)css.ch> wrote:
If I get it right, there's no difference
between storing something as hex
or storing it as binary, because hex is just a shorter form of
presentation for binary values, right?
Hex takes two bytes per byte, while binary takes one byte per byte.
Right.
Is
there any reason not store binary values as binary data, even though
they may be used later in an other representation?
Hex is easier to work with in a number of circumstances:
1) No worries about encoding and valid byte values.
2) Dumping debug information to a console is easier when it's legible
and doesn't contain non-printable characters.
3) Digging in the database to do any sort of manual work is a lot easier
when you're dealing with sequences of [0-9a-f] than [\x00-\xff]. It
doesn't mess up your terminal, and cut-n-paste works.
4) When the in-database keys match up with filenames in hex, it's rather
handy to use the same representation in both places.
Whereas the only benefit to storing raw binary is: it saves a few bytes
per row.
- -- brion vibber (brion @
wikimedia.org)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iD8DBQFGZWkUwRnhpk1wk44RAgEIAJ9bUbE9cEKuywz4SHBYc9pVyd+QzgCdFyye
FVprbcdI93aQ7YPm8jMzdxA=
=CjqN
-----END PGP SIGNATURE-----