17 lines
220 B
Go
17 lines
220 B
Go
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
|
|
}
|