Skip to content

CBOR.decode("\xC6".b) raises CBOR::DecodingError` #12

@grzuy

Description

@grzuy

Hi,

Apparently I can decode tags 0 to 5, but starting from 6 it returns CBOR::DecodingError. Is this expected?

$ irb
irb(main):001:0> require "libcbor/all"
~/.gem/ruby/2.6.5/gems/libcbor-0.1.0/lib/libcbor.rb:50: warning: constant ::Fixnum is deprecated
=> true
irb(main):002:0> CBOR.decode(CBOR.encode(CBOR::Tag.new(0, "")))
=> #<struct CBOR::Tag value=0, item="">
irb(main):003:0> CBOR.decode(CBOR.encode(CBOR::Tag.new(5, "")))
=> #<struct CBOR::Tag value=5, item="">
irb(main):004:0> CBOR.decode(CBOR.encode(CBOR::Tag.new(6, "")))
Traceback (most recent call last):
        7: from ~/.rubies/ruby-2.6.5/bin/irb:23:in `<main>'
        6: from ~/.rubies/ruby-2.6.5/bin/irb:23:in `load'
        5: from ~/.rubies/ruby-2.6.5/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
        4: from (irb):4
        3: from ~/.gem/ruby/2.6.5/gems/libcbor-0.1.0/lib/libcbor.rb:65:in `decode'
        2: from ~/.gem/ruby/2.6.5/gems/libcbor-0.1.0/lib/libcbor.rb:65:in `tap'
        1: from ~/.gem/ruby/2.6.5/gems/libcbor-0.1.0/lib/libcbor.rb:65:in `block in decode'
CBOR::DecodingError (CBOR::DecodingError)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions