2 years ago

#97220

test-img

Vidya

Python string hashing without collision

Is there any approach to implement hashing without any collisions in python 3?

I am using mmh3 provided by mmh3

import mmh3
string = "/hjhfkhdf/jefhfueiow-/eflkjhfeiero-kk&/kerdfujelifjr(0kjlegjfejf/?/jdfkhe"
mmh3.hash128(string)

To avoid collisions and I am implementing Salt (or seed). is that good enough for uniqueness?

import mmh3
string = "/hjhfkhdf/jefhfueiow-/eflkjhfeiero-kk&/kerdfujelifjr(0kjlegjfejf/?/jdfkhe"
mmh3.hash128(string, 12, signed=True)

Purpose:

my string contains special characters and long string, I need to update in DB and index it. I am assuming (May be wrong), query with special characters lead issues. this is the reason I am generating hashing and store in DB. If my assumption is wrong then I can store original value

python

python-3.x

hash

murmurhash

0 Answers

Your Answer

Accepted video resources