I have a []byte
, made from a string:
array := []byte("some string")
It looks like expected:
[115 111 109 101 32 115 116 114 105 110 103]
Is there a way to simply get the checksum of []byte? Like:
sum(array)
Maybe you need md5.sum to check reliability.
https://pkg.go.dev/crypto/md5#Sum
package main
import (
"crypto/md5"
"fmt"
)
func main() {
data := []byte("some string")
fmt.Printf("%x", md5.Sum(data))
}
Another example.