diff --git a/sdk/hints/badgerh/keys.go b/sdk/hints/badgerh/keys.go index 5c74f18..3673a4b 100644 --- a/sdk/hints/badgerh/keys.go +++ b/sdk/hints/badgerh/keys.go @@ -3,7 +3,6 @@ package badgerh import ( "encoding/binary" "encoding/hex" - "unsafe" "github.com/nbd-wtf/go-nostr" ) @@ -11,7 +10,7 @@ import ( func encodeKey(pubhintkey, relay string) []byte { k := make([]byte, 32+len(relay)) hex.Decode(k[0:32], []byte(pubhintkey)) - copy(k[32:], unsafe.Slice(unsafe.StringData(relay), len(relay))) + copy(k[32:], relay) return k } diff --git a/sdk/hints/lmdbh/keys.go b/sdk/hints/lmdbh/keys.go index bd6a89e..2ff5c1c 100644 --- a/sdk/hints/lmdbh/keys.go +++ b/sdk/hints/lmdbh/keys.go @@ -3,7 +3,6 @@ package lmdbh import ( "encoding/binary" "encoding/hex" - "unsafe" "github.com/nbd-wtf/go-nostr" ) @@ -11,7 +10,7 @@ import ( func encodeKey(pubhintkey, relay string) []byte { k := make([]byte, 32+len(relay)) hex.Decode(k[0:32], []byte(pubhintkey)) - copy(k[32:], unsafe.Slice(unsafe.StringData(relay), len(relay))) + copy(k[32:], relay) return k } @@ -37,4 +36,4 @@ func parseValue(v []byte) timestamps { nostr.Timestamp(binary.LittleEndian.Uint32(v[8:])), nostr.Timestamp(binary.LittleEndian.Uint32(v[12:])), } -} \ No newline at end of file +}