mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
non ported html fix
This commit is contained in:
parent
e6cc6347e2
commit
acff24ad46
@ -1,6 +1,7 @@
|
||||
package event
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
@ -81,8 +82,12 @@ func (evt *Event) Serialize() []byte {
|
||||
// content
|
||||
arr[5] = evt.Content
|
||||
|
||||
serialized, _ := json.Marshal(arr)
|
||||
return serialized
|
||||
serialized := new(bytes.Buffer)
|
||||
|
||||
enc := json.NewEncoder(serialized)
|
||||
enc.SetEscapeHTML(false)
|
||||
_ = enc.Encode(arr)
|
||||
return serialized.Bytes()[:serialized.Len()-1] // Encode add new line char
|
||||
}
|
||||
|
||||
// CheckSignature checks if the signature is valid for the id
|
||||
|
Loading…
x
Reference in New Issue
Block a user