An application, i need sha1 encryption,but the results are different between python and java, java is correct. Because there is no byte object in python, and java byte is used for hash calculation. How to get the correct results with python?
As usual, the difference is not in the digest implementation (those are well-documented and implemented correctly in all major libraries). The difference is in how you represent the resulting data.
You probably want the digest to be represented in a hex- or Base64 encoding.
Try this (make sure to import
Alternatively, if you need Base64, use