13 lines
195 B
Go
13 lines
195 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func Sha256Hash(key string) []byte {
|
|
bytes, _ := hex.DecodeString(key)
|
|
sha256_hash := sha256.Sum256(bytes)
|
|
return sha256_hash[:]
|
|
}
|