SHA3-256 function

Hi folks!

I’m looking for a function to convert a string (e.g. “Vicia faba”) into a HASH code using SHA3-256.

I noticed that there is a “hashlib” for Python with a “sha3_256” function, but I couldn’t make it work.

Any thoughts?

Thanks in advance!

Eduardo

Try this:

import hashlib
return hashlib.sha3_256($A.encode('utf-8')).hexdigest()
1 Like

Brilliant! Thanks! I also tried the AI and works fine with something very similar.