mirror of
https://github.com/KevinMidboe/planetposen-images.git
synced 2025-10-29 05:10:12 +00:00
15 lines
215 B
Go
15 lines
215 B
Go
package util
|
|
|
|
import (
|
|
"crypto/sha1"
|
|
"fmt"
|
|
)
|
|
|
|
// Hash hashes a string using sha1
|
|
func Hash(s string) string {
|
|
hash := sha1.New()
|
|
_, _ = hash.Write([]byte(s))
|
|
bs := hash.Sum(nil)
|
|
return fmt.Sprintf("%x", bs)
|
|
}
|