13 lines
185 B
Go
13 lines
185 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"crypto/sha1"
|
||
|
"encoding/hex"
|
||
|
)
|
||
|
|
||
|
func hash(text string) string {
|
||
|
hasher := sha1.New()
|
||
|
hasher.Write([]byte(text))
|
||
|
return hex.EncodeToString(hasher.Sum(nil))
|
||
|
}
|