Skip to content

Commit

Permalink
feat: support for CBOR tag 24 (wrapped CBOR)
Browse files Browse the repository at this point in the history
  • Loading branch information
agaffney committed Oct 1, 2023
1 parent 759464f commit 63541e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cbor/cbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
CBOR_MAX_UINT_SIMPLE uint8 = 0x17

// Useful tag numbers
CborTagCbor = 24
CborTagRational = 30
CborTagSet = 258
CborTagMap = 259
Expand Down
2 changes: 2 additions & 0 deletions cbor/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func (v *Value) UnmarshalCBOR(data []byte) error {
return err
}
switch tmpTag.Number {
case CborTagCbor:
v.value = tmpTag.Content
case CborTagRational:
var tmpRat []int64
if _, err := Decode(tmpTag.Content, &tmpRat); err != nil {
Expand Down

0 comments on commit 63541e3

Please sign in to comment.