Open yasirysr47 opened 8 months ago
the function hash logic
is a lambda function that takes 3 arguments freq1
, freq2
, offset
.
inside this function:
-the string f"{freq1}|{freq2}|{offset}" is created, concatenating the three arguments separated by the pipe character |.
-then it is encoded to byte datatype using UTF-8 encoding
-the hashlib.sha1() computes the hash for this encoded string
-the hex digest function is called to convert this hash value to hexadecimal format
-finally the hexadecimal hash is sliced including only the first 25 characters to save memory
https://github.com/akgupta1337/Shazzam-Clone/blame/75b18e81d8cfbfc10710b79d5227942ee405dbec/logic/Shazzam.py#L75C2-L77C2