Browse Source

add util for md5

pull/1273/head
Chris Lu 5 years ago
parent
commit
00b993a234
  1. 7
      weed/util/bytes.go

7
weed/util/bytes.go

@ -2,6 +2,7 @@ package util
import (
"crypto/md5"
"fmt"
"io"
)
@ -91,3 +92,9 @@ func HashToInt32(data []byte) (v int32) {
return
}
func Md5(data []byte) string {
hash := md5.New()
hash.Write(data)
return fmt.Sprintf("%x", hash.Sum(nil))
}
Loading…
Cancel
Save