jldb/lib/rep/psk.go

17 lines
220 B
Go
Raw Normal View History

2023-10-16 08:50:19 +00:00
package rep
import (
"crypto/sha256"
"encoding/hex"
)
func pskToBytes(in string) [64]byte {
b := sha256.Sum256([]byte(in))
dst := [64]byte{}
i := hex.Encode(dst[:], b[:])
if i != 64 {
panic(i)
}
return dst
}