文章目录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main

import (
"crypto/sha1"
"encoding/hex"
"fmt"
)

func SHA1(s string) string {
o := sha1.New()
o.Write([]byte(s))
return hex.EncodeToString(o.Sum(nil))
}

func main(){
fmt.Println(SHA1("123456"))
}
文章目录