[TYPO3-english] Duplicate cHash values

Dmitry Martynenko dima at realt.by
Mon Jan 19 12:05:21 CET 2009


Hi Dmitry,

>> May be better solution is to decrease key length - for example use 16
>> byte (binary) MD5 value, instead of 32 chars value. In any case they are equal.
>> Binary comparison is always faster then text comparison. Because text
>> comparison also takes in account character sets and case sensitivity.

DD> md5 provides uniqueness only if it is full 32-bit value. Using 16
DD> bit will decrease probablity of conflict but will not eliminate it.

I mean another thing!

MD5 has 128 bit value (not 16 bit or 32 bit)

In binary it is 16 byte value (16 * 8 = 128 bit)
In HEX it has presentation of 32 chars value (2 chars for each byte)

I suggest to store it as 16 byte value in BINARY(16) MySQL field,
instead of using 32 char value in CHAR(32) MySQL field.
In PHP it is represented as HEX value in both case.

I think it is faster for search and leads to smaller DB size.

-- 
Dmitry Martynenko
Developer

Web: http://realt.by



More information about the TYPO3-english mailing list