I know there is hashlib in Python, but I want to achieve the same result as in Go below:
package main
import (
"crypto/md5"
"fmt"
)
func main() {
data := []byte("12345")
fmt.Println("sum ", md5.Sum(data))
}
As func md5.Sum described, it calculates "MD5 checksum of the data". However, I don't find any similar function in Python.
Is there any way to achieve md5.Sum
in Python as in Go?
The output of program above is a slice other than a string:
sum [32 44 185 98 172 89 7 91 150 75 7 21 45 35 75 112]