Skip to content
/ binary Public
forked from gagliardetto/binary

Encoding/decoding in Borsh and other formats.

License

Notifications You must be signed in to change notification settings

ozgb/binary

 
 

Repository files navigation

binary

Borsh

Decoding borsh

 dec := bin.NewBorshDecoder(data)
 var meta token_metadata.Metadata
 err = dec.Decode(&meta)
 if err != nil {
   panic(err)
 }

Encoding borsh

buf := new(bytes.Buffer)
enc := bin.NewBorshEncoder(buf)
err := enc.Encode(meta)
if err != nil {
  panic(err)
}
// fmt.Print(buf.Bytes())

About

Encoding/decoding in Borsh and other formats.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%