I have a NoSQL key-value database. I want to insert couple million of records to it.
For the key generation, I'm, using a prefix (something like
data-one-) and then concat the SHA256 hash of something unique to the value stored. So the end key might look like
The problem is that the key is somewhat large and it will have impact of the DB performance. I want to chop off some of the hash to get a 64-bit string (so, 8 chars). So I'd chop the above key to
But will it leave enough entropy for the remaining key? The DB will get large, and I don't want collisions, obviously. Will another hash be more suitable for this use, or is trimming SHA256 fine?