Generating valid identifiers
gandalf at shopzeus.com
Thu Jul 26 20:08:59 CEST 2012
>> * Would it be a problem to use CRC32 instead of SHA? (Since security is
>> not a problem, and CRC32 is faster.)
> What happens if you get a collision?
> That is, you have two different long identifiers:
> which by bad luck both hash to the same value:
> (or whatever).
Yes, that was the question. How do I avoid that? (Of course I can avoid
that by using a full sha256 hash value.)
>> * Can somebody think of a
>> better algorithm, that would give a bigger chance of recognizing the
>> original identifier from the modified one?
> Rather than truncating the most significant part of the identifier, the
> field name, you should truncate the least important part, the middle.
> goes to:
> or similar.
Yes, this is a good idea. Thank you.
More information about the Python-list