Skip to content

Instantly share code, notes, and snippets.

@ckeyer
Created November 5, 2015 03:50
Show Gist options
  • Save ckeyer/9d5940776be881281084 to your computer and use it in GitHub Desktop.
Save ckeyer/9d5940776be881281084 to your computer and use it in GitHub Desktop.
Hash 用法
package rand
import (
"crypto/md5"
"encoding/hex"
)
func md5(data string) string {
h := md5.New()
h.Write([]byte(data))
return hex.EncodeToString(h.Sum(nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment