mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-23 15:21:20 +02:00
ensure private key is 64 characters long.
fixes https://github.com/nbd-wtf/go-nostr/issues/111
This commit is contained in:
parent
307df51b9a
commit
0cfaa0da0a
3
keys.go
3
keys.go
@ -3,6 +3,7 @@ package nostr
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/big"
|
||||
"strings"
|
||||
@ -25,7 +26,7 @@ func GeneratePrivateKey() string {
|
||||
k.Mod(k, n)
|
||||
k.Add(k, one)
|
||||
|
||||
return hex.EncodeToString(k.Bytes())
|
||||
return fmt.Sprintf("%064x", k.Bytes())
|
||||
}
|
||||
|
||||
func GetPublicKey(sk string) (string, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user