13 lines
166 B
Go
13 lines
166 B
Go
package hash
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func MD5(str []byte, b ...byte) string {
|
|
h := md5.New()
|
|
h.Write(str)
|
|
return hex.EncodeToString(h.Sum(b))
|
|
}
|