mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
18 lines
252 B
Go
18 lines
252 B
Go
package libcore
|
|
|
|
import (
|
|
"crypto/sha1"
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func Sha1(data []byte) []byte {
|
|
sum := sha1.Sum(data)
|
|
return sum[:]
|
|
}
|
|
|
|
func Sha256Hex(data []byte) string {
|
|
sum := sha256.Sum256(data)
|
|
return hex.EncodeToString(sum[:])
|
|
}
|