deprecation notice on binary package.

This commit is contained in:
fiatjaf 2024-05-29 15:30:21 -03:00
parent f8bf988882
commit 0e93b1173f
2 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/nbd-wtf/go-nostr"
)
// Deprecated -- the encoding used here is not very elegant, we'll have a better binary format later.
func UnmarshalBinary(data []byte, evt *Event) (err error) {
defer func() {
if r := recover(); r != nil {
@ -47,6 +48,7 @@ func UnmarshalBinary(data []byte, evt *Event) (err error) {
return err
}
// Deprecated -- the encoding used here is not very elegant, we'll have a better binary format later.
func MarshalBinary(evt *Event) []byte {
content := []byte(evt.Content)
buf := make([]byte, 32+32+64+4+2+2+len(content)+65536 /* blergh */)

View File

@ -8,6 +8,7 @@ import (
"github.com/nbd-wtf/go-nostr"
)
// Deprecated -- the encoding used here is not very elegant, we'll have a better binary format later.
func Unmarshal(data []byte, evt *nostr.Event) (err error) {
defer func() {
if r := recover(); r != nil {
@ -48,6 +49,7 @@ func Unmarshal(data []byte, evt *nostr.Event) (err error) {
return err
}
// Deprecated -- the encoding used here is not very elegant, we'll have a better binary format later.
func Marshal(evt *nostr.Event) ([]byte, error) {
content := []byte(evt.Content)
buf := make([]byte, 32+32+64+4+2+2+len(content)+65536+len(evt.Tags)*40 /* blergh */)