File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 55 "github.com/fxamacker/cbor/v2"
66)
77
8+ // CborEncode encodes the provided data as CBOR using the correct mode
89func CborEncode (data interface {}) ([]byte , error ) {
910 buf := bytes .NewBuffer (nil )
1011 em , err := cbor .CoreDetEncOptions ().EncMode ()
@@ -16,6 +17,7 @@ func CborEncode(data interface{}) ([]byte, error) {
1617 return buf .Bytes (), err
1718}
1819
20+ // CborDecode decodes the provided CBOR into the given destination
1921func CborDecode (dataBytes []byte , dest interface {}) (int , error ) {
2022 data := bytes .NewReader (dataBytes )
2123 dec := cbor .NewDecoder (data )
Original file line number Diff line number Diff line change 55 "fmt"
66)
77
8+ // DumpCborStructure generates an indented string representing an arbitrary data structure for debugging purposes
89func DumpCborStructure (data interface {}, prefix string ) string {
910 var ret bytes.Buffer
1011 switch v := data .(type ) {
Original file line number Diff line number Diff line change 1+ // Package utils provides random utility functions
2+ package utils
You can’t perform that action at this time.
0 commit comments