2 ms·
You want to store hashed value in database as effectively as possible, hence the first 8 bytes. Though I think a 64 bits hash algorithms might be more suitable
by npn 2y ago
You want to store hashed value in database as effectively as possible, hence the first 8 bytes.
Though I think a 64 bits hash algorithms might be more suitable than sha1. Personally I use fnv-1a for hashing (not the fastest but trivial to implement) instead.