mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-03 03:31:02 +02:00
deprecation notice on binary package.
This commit is contained in:
parent
f8bf988882
commit
0e93b1173f
@ -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 */)
|
||||
|
@ -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 */)
|
||||
|
Loading…
x
Reference in New Issue
Block a user