Skip to content

Commit

Permalink
Merge pull request #389 from blinklabs-io/feat/cbor-tag-wrapped-cbor
Browse files Browse the repository at this point in the history
feat: support for CBOR tag 24 (wrapped CBOR)
  • Loading branch information
agaffney authored Oct 1, 2023
2 parents 759464f + 63541e3 commit 20004b3
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 20004b3

Please sign in to comment.