30 Jan 2020 06:05:05 UTC
- Distribution: CBOR-PP
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (307 / 1 / 2)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Perl: v5.10.0
- Activity24 month
- Download (18.62KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionFELIPE Felipe Gasperand 1 contributors
- Felipe Gasper (FELIPE)
- MAPPING CBOR TO PERL
my $perlvar = CBOR::PP::Decode::decode($binary);
This implements a basic CBOR decoder in pure Perl.
All tags are ignored. (This could be iterated on later.)
Indefinite-length objects are supported, but streamed parsing is not; the data structure must be complete to be decoded.
CBOR text strings are decoded to UTF8-flagged strings, while binary strings are decoded to non-UTF8-flagged strings. In practical terms, this means that a decoded CBOR binary string will have no code point above 255, while a decoded CBOR text string can contain any valid Unicode code point.
null, undefined, true, and false become undef, undef, Types::Serialiser::true(), and Types::Serialiser::false(), respectively. (NB: undefined is deserialized as an error object in CBOR::XS, which doesn’t seem to make sense.)
Add tag decode support via callbacks.
Make it faster by removing some of the internal buffer copying.
Gasper Software Consulting (FELIPE)
This code is licensed under the same license as Perl itself.
Returns a Perl value that represents the serialized CBOR string.