I need to convert string to SHA1 hexadecimal hash below is the code I am using:
val md = java.security.MessageDigest.getInstance("SHA-1")
val ha = new sun.misc.HexDumpEncoder().encode(md.digest("Foo".getBytes))
print(ha)
but i donot get hexadecimal value, I can achive this in python using below piece of code:
int(hashlib.sha1("Foo".encode(encoding='UTF-8', errors='strict')).hexdigest(), 16)
what is the relevent hexdigest()
of python in scala