From df91c866d4662ecf734bccd129d0ac426804cb8e Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Thu, 18 Jul 2024 10:32:57 +0200 Subject: [PATCH] Update string length and license check functions, and update dependencies The update includes switching from `mb_strlen` to `strlen` function for getting string length in several classes. This also includes refactoring the license check function and removing the Coveralls section from the GitHub action workflow. Lastly, all outdated dependencies have been updated. --- .github/workflows/integrate.yml | 8 - castor.php | 9 +- composer.json | 6 +- deptrac.yaml | 6 +- phpunit.xml.dist | 2 +- rector.php | 3 +- src/ByteStringObject.php | 4 +- src/LengthCalculator.php | 5 +- .../DoublePrecisionFloatObject.php | 3 +- src/OtherObject/HalfPrecisionFloatObject.php | 3 +- src/OtherObject/SimpleObject.php | 3 +- .../SinglePrecisionFloatObject.php | 3 +- src/StringStream.php | 9 +- src/Tag/TimestampTag.php | 5 +- tests/vectors.json | 466 +++--------------- 15 files changed, 115 insertions(+), 420 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index baae9ba..fbbcd69 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -83,14 +83,6 @@ jobs: - name: "Execute tests (PHP)" run: "castor test --coverage-text" - # - name: Send coverage to Coveralls - # if: "matrix.php-version == '8.1' && matrix.dependencies == 'highest'" - # env: - # COVERALLS_REPO_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # run: | - # wget "https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.2/php-coveralls.phar" - # php ./php-coveralls.phar -v - static_analysis: name: "3️⃣ Static Analysis" needs: diff --git a/castor.php b/castor.php index 8123e27..a3271ad 100644 --- a/castor.php +++ b/castor.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use Castor\Attribute\AsOption; use Castor\Attribute\AsTask; use function Castor\io; use function Castor\run; @@ -99,10 +100,10 @@ function validate(): void */ #[AsTask(description: 'Check licenses')] function checkLicenses( + #[AsOption(description: 'Allowed licenses.')] array $allowedLicenses = ['Apache-2.0', 'BSD-2-Clause', 'BSD-3-Clause', 'ISC', 'MIT', 'MPL-2.0', 'OSL-3.0'] ): void { io()->title('Checking licenses'); - $allowedExceptions = []; $command = ['composer', 'licenses', '-f', 'json']; $environment = [ 'XDEBUG_MODE' => 'off', @@ -115,14 +116,12 @@ function checkLicenses( $licenses = json_decode($result->getOutput(), true); $disallowed = array_filter( $licenses['dependencies'], - static fn (array $info, $name) => ! in_array($name, $allowedExceptions, true) - && count(array_diff($info['license'], $allowedLicenses)) === 1, + static fn (array $info, $name) => count(array_diff($info['license'], $allowedLicenses)) === 1, \ARRAY_FILTER_USE_BOTH ); $allowed = array_filter( $licenses['dependencies'], - static fn (array $info, $name) => in_array($name, $allowedExceptions, true) - || count(array_diff($info['license'], $allowedLicenses)) === 0, + static fn (array $info, $name) => count(array_diff($info['license'], $allowedLicenses)) === 0, \ARRAY_FILTER_USE_BOTH ); if (count($disallowed) > 0) { diff --git a/composer.json b/composer.json index 323e169..77ce00d 100644 --- a/composer.json +++ b/composer.json @@ -31,20 +31,20 @@ "require-dev": { "ext-json": "*", "ekino/phpstan-banned-code": "^1.0", - "infection/infection": "^0.28", + "infection/infection": "^0.29", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-beberlei-assert": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^10.1", + "phpunit/phpunit": "^10.1|^11.0", "rector/rector": "^1.0", "roave/security-advisories": "dev-latest", "symfony/var-dumper": "^6.0|^7.0", "symplify/easy-coding-standard": "^12.0", "php-parallel-lint/php-parallel-lint": "^1.3", - "qossmic/deptrac-shim": "^1.0" + "qossmic/deptrac": "^2.0" }, "config": { "sort-packages": true, diff --git a/deptrac.yaml b/deptrac.yaml index 7573742..45f331c 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -4,11 +4,11 @@ parameters: layers: - name: 'CBOR' collectors: - - type: 'className' - regex: '^CBO\\' + - type: 'classLike' + value: '^CBO\\' - name: 'Vendors' collectors: - - { type: className, regex: '^Brick\\' } + - { type: 'classLike', value: '^Brick\\' } ruleset: CBOR: - Vendors diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5e6c56f..e0a107d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -17,7 +17,7 @@ - src + src diff --git a/rector.php b/rector.php index 0e6ac9a..dbbe83e 100644 --- a/rector.php +++ b/rector.php @@ -4,7 +4,6 @@ use Rector\Config\RectorConfig; use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; -use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; @@ -15,7 +14,7 @@ $config->import(SetList::DEAD_CODE); $config->import(LevelSetList::UP_TO_PHP_80); $config->import(SymfonySetList::SYMFONY_CODE_QUALITY); - $config->import(PHPUnitLevelSetList::UP_TO_PHPUNIT_100); + $config->import(PHPUnitSetList::PHPUNIT_100); $config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY); $config->parallel(); $config->paths([__DIR__ . '/src', __DIR__ . '/tests']); diff --git a/src/ByteStringObject.php b/src/ByteStringObject.php index b7bb01f..189589a 100644 --- a/src/ByteStringObject.php +++ b/src/ByteStringObject.php @@ -4,6 +4,8 @@ namespace CBOR; +use function strlen; + /** * @see \CBOR\Test\ByteStringObjectTest */ @@ -46,7 +48,7 @@ public function getValue(): string public function getLength(): int { - return mb_strlen($this->value, '8bit'); + return strlen($this->value); } public function normalize(): string diff --git a/src/LengthCalculator.php b/src/LengthCalculator.php index ec8c678..da43ce8 100644 --- a/src/LengthCalculator.php +++ b/src/LengthCalculator.php @@ -8,6 +8,7 @@ use InvalidArgumentException; use function chr; use function count; +use function strlen; use const STR_PAD_LEFT; final class LengthCalculator @@ -17,7 +18,7 @@ final class LengthCalculator */ public static function getLengthOfString(string $data): array { - $length = mb_strlen($data, '8bit'); + $length = strlen($data); return self::computeLength($length); } @@ -54,7 +55,7 @@ private static function computeLength(int $length): array private static function hex2bin(string $data): string { - $data = str_pad($data, (int) (2 ** ceil(log(mb_strlen($data, '8bit'), 2))), '0', STR_PAD_LEFT); + $data = str_pad($data, (int) (2 ** ceil(log(strlen($data), 2))), '0', STR_PAD_LEFT); $result = hex2bin($data); if ($result === false) { throw new InvalidArgumentException('Unable to convert the data'); diff --git a/src/OtherObject/DoublePrecisionFloatObject.php b/src/OtherObject/DoublePrecisionFloatObject.php index db3a1d2..a088126 100644 --- a/src/OtherObject/DoublePrecisionFloatObject.php +++ b/src/OtherObject/DoublePrecisionFloatObject.php @@ -9,6 +9,7 @@ use CBOR\OtherObject as Base; use CBOR\Utils; use InvalidArgumentException; +use function strlen; use const INF; use const NAN; @@ -26,7 +27,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string public static function create(string $value): self { - if (mb_strlen($value, '8bit') !== 8) { + if (strlen($value) !== 8) { throw new InvalidArgumentException('The value is not a valid double precision floating point'); } diff --git a/src/OtherObject/HalfPrecisionFloatObject.php b/src/OtherObject/HalfPrecisionFloatObject.php index 467e0c2..ba114b9 100644 --- a/src/OtherObject/HalfPrecisionFloatObject.php +++ b/src/OtherObject/HalfPrecisionFloatObject.php @@ -9,6 +9,7 @@ use CBOR\OtherObject as Base; use CBOR\Utils; use InvalidArgumentException; +use function strlen; use const INF; use const NAN; @@ -26,7 +27,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string public static function create(string $value): self { - if (mb_strlen($value, '8bit') !== 2) { + if (strlen($value) !== 2) { throw new InvalidArgumentException('The value is not a valid half precision floating point'); } diff --git a/src/OtherObject/SimpleObject.php b/src/OtherObject/SimpleObject.php index 2766dd2..f43a691 100644 --- a/src/OtherObject/SimpleObject.php +++ b/src/OtherObject/SimpleObject.php @@ -10,6 +10,7 @@ use InvalidArgumentException; use function chr; use function ord; +use function strlen; final class SimpleObject extends Base implements Normalizable { @@ -46,7 +47,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string if ($data === null) { throw new InvalidArgumentException('Invalid simple value. Content data is missing.'); } - if (mb_strlen($data, '8bit') !== 1) { + if (strlen($data) !== 1) { throw new InvalidArgumentException('Invalid simple value. Content data is too long.'); } if (ord($data) < 32) { diff --git a/src/OtherObject/SinglePrecisionFloatObject.php b/src/OtherObject/SinglePrecisionFloatObject.php index d47cd30..a381004 100644 --- a/src/OtherObject/SinglePrecisionFloatObject.php +++ b/src/OtherObject/SinglePrecisionFloatObject.php @@ -8,6 +8,7 @@ use CBOR\OtherObject as Base; use CBOR\Utils; use InvalidArgumentException; +use function strlen; use const INF; use const NAN; @@ -25,7 +26,7 @@ public static function createFromLoadedData(int $additionalInformation, ?string public static function create(string $value): self { - if (mb_strlen($value, '8bit') !== 4) { + if (strlen($value) !== 4) { throw new InvalidArgumentException('The value is not a valid single precision floating point'); } diff --git a/src/StringStream.php b/src/StringStream.php index d522813..82267f6 100644 --- a/src/StringStream.php +++ b/src/StringStream.php @@ -6,6 +6,7 @@ use InvalidArgumentException; use RuntimeException; +use function strlen; final class StringStream implements Stream { @@ -53,21 +54,21 @@ public function read(int $length): string if ($newData === false) { throw new RuntimeException('Unable to read the memory'); } - if (mb_strlen($newData, '8bit') < $sizeToRead) { + if (strlen($newData) < $sizeToRead) { throw new InvalidArgumentException(sprintf( 'Out of range. Expected: %d, read: %d.', $length, - mb_strlen($data, '8bit') + strlen($data) )); } $data .= $newData; } - if (mb_strlen($data, '8bit') !== $length) { + if (strlen($data) !== $length) { throw new InvalidArgumentException(sprintf( 'Out of range. Expected: %d, read: %d.', $length, - mb_strlen($data, '8bit') + strlen($data) )); } diff --git a/src/Tag/TimestampTag.php b/src/Tag/TimestampTag.php index afdec9f..a3b457e 100644 --- a/src/Tag/TimestampTag.php +++ b/src/Tag/TimestampTag.php @@ -15,6 +15,7 @@ use DateTimeImmutable; use DateTimeInterface; use InvalidArgumentException; +use function strlen; use const STR_PAD_RIGHT; final class TimestampTag extends Tag implements Normalizable @@ -60,8 +61,8 @@ public function normalize(): DateTimeInterface $value = (string) $object->normalize(); $parts = explode('.', $value); if (isset($parts[1])) { - if (mb_strlen($parts[1], '8bit') > 6) { - $parts[1] = mb_substr($parts[1], 0, 6, '8bit'); + if (strlen($parts[1]) > 6) { + $parts[1] = substr($parts[1], 0, 6); } else { $parts[1] = str_pad($parts[1], 6, '0', STR_PAD_RIGHT); } diff --git a/tests/vectors.json b/tests/vectors.json index 1566e86..a427935 100644 --- a/tests/vectors.json +++ b/tests/vectors.json @@ -1,630 +1,326 @@ [ { "cbor": "AA==", - "hex": "00", - "roundtrip": true, - "decoded": 0 + "hex": "00" }, { "cbor": "AQ==", - "hex": "01", - "roundtrip": true, - "decoded": 1 + "hex": "01" }, { "cbor": "Cg==", - "hex": "0a", - "roundtrip": true, - "decoded": 10 + "hex": "0a" }, { "cbor": "Fw==", - "hex": "17", - "roundtrip": true, - "decoded": 23 + "hex": "17" }, { "cbor": "GBg=", - "hex": "1818", - "roundtrip": true, - "decoded": 24 + "hex": "1818" }, { "cbor": "GBk=", - "hex": "1819", - "roundtrip": true, - "decoded": 25 + "hex": "1819" }, { "cbor": "GGQ=", - "hex": "1864", - "roundtrip": true, - "decoded": 100 + "hex": "1864" }, { "cbor": "GQPo", - "hex": "1903e8", - "roundtrip": true, - "decoded": 1000 + "hex": "1903e8" }, { "cbor": "GgAPQkA=", - "hex": "1a000f4240", - "roundtrip": true, - "decoded": 1000000 + "hex": "1a000f4240" }, { "cbor": "GwAAAOjUpRAA", - "hex": "1b000000e8d4a51000", - "roundtrip": true, - "decoded": 1000000000000 + "hex": "1b000000e8d4a51000" }, { "cbor": "G///////////", - "hex": "1bffffffffffffffff", - "roundtrip": true, - "decoded": 18446744073709551615 + "hex": "1bffffffffffffffff" }, { "cbor": "wkkBAAAAAAAAAAA=", - "hex": "c249010000000000000000", - "roundtrip": true, - "decoded": 18446744073709551616 + "hex": "c249010000000000000000" }, { "cbor": "O///////////", - "hex": "3bffffffffffffffff", - "roundtrip": true, - "decoded": -18446744073709551616 + "hex": "3bffffffffffffffff" }, { "cbor": "w0kBAAAAAAAAAAA=", - "hex": "c349010000000000000000", - "roundtrip": true, - "decoded": -18446744073709551617 + "hex": "c349010000000000000000" }, { "cbor": "IA==", - "hex": "20", - "roundtrip": true, - "decoded": -1 + "hex": "20" }, { "cbor": "KQ==", - "hex": "29", - "roundtrip": true, - "decoded": -10 + "hex": "29" }, { "cbor": "OGM=", - "hex": "3863", - "roundtrip": true, - "decoded": -100 + "hex": "3863" }, { "cbor": "OQPn", - "hex": "3903e7", - "roundtrip": true, - "decoded": -1000 + "hex": "3903e7" }, { "cbor": "+QAA", - "hex": "f90000", - "roundtrip": true, - "decoded": 0.0 + "hex": "f90000" }, { "cbor": "+YAA", - "hex": "f98000", - "roundtrip": true, - "decoded": -0.0 + "hex": "f98000" }, { "cbor": "+TwA", - "hex": "f93c00", - "roundtrip": true, - "decoded": 1.0 + "hex": "f93c00" }, { "cbor": "+z/xmZmZmZma", - "hex": "fb3ff199999999999a", - "roundtrip": true, - "decoded": 1.1 + "hex": "fb3ff199999999999a" }, { "cbor": "+T4A", - "hex": "f93e00", - "roundtrip": true, - "decoded": 1.5 + "hex": "f93e00" }, { "cbor": "+Xv/", - "hex": "f97bff", - "roundtrip": true, - "decoded": 65504.0 + "hex": "f97bff" }, { "cbor": "+kfDUAA=", - "hex": "fa47c35000", - "roundtrip": true, - "decoded": 100000.0 + "hex": "fa47c35000" }, { "cbor": "+n9///8=", - "hex": "fa7f7fffff", - "roundtrip": true, - "decoded": 3.4028234663852886e+38 + "hex": "fa7f7fffff" }, { "cbor": "+3435DyIAHWc", - "hex": "fb7e37e43c8800759c", - "roundtrip": true, - "decoded": 1.0e+300 + "hex": "fb7e37e43c8800759c" }, { "cbor": "+QAB", - "hex": "f90001", - "roundtrip": true, - "decoded": 5.960464477539063e-08 + "hex": "f90001" }, { "cbor": "+QQA", - "hex": "f90400", - "roundtrip": true, - "decoded": 6.103515625e-05 + "hex": "f90400" }, { "cbor": "+cQA", - "hex": "f9c400", - "roundtrip": true, - "decoded": -4.0 + "hex": "f9c400" }, { "cbor": "+8AQZmZmZmZm", - "hex": "fbc010666666666666", - "roundtrip": true, - "decoded": -4.1 + "hex": "fbc010666666666666" }, { "cbor": "+XwA", - "hex": "f97c00", - "roundtrip": true, - "diagnostic": "Infinity" + "hex": "f97c00" }, { "cbor": "+X4A", - "hex": "f97e00", - "roundtrip": true, - "diagnostic": "NaN" + "hex": "f97e00" }, { "cbor": "+fwA", - "hex": "f9fc00", - "roundtrip": true, - "diagnostic": "-Infinity" + "hex": "f9fc00" }, { "cbor": "+n+AAAA=", - "hex": "fa7f800000", - "roundtrip": false, - "diagnostic": "Infinity" + "hex": "fa7f800000" }, { "cbor": "+n/AAAA=", - "hex": "fa7fc00000", - "roundtrip": false, - "diagnostic": "NaN" + "hex": "fa7fc00000" }, { "cbor": "+v+AAAA=", - "hex": "faff800000", - "roundtrip": false, - "diagnostic": "-Infinity" + "hex": "faff800000" }, { "cbor": "+3/wAAAAAAAA", - "hex": "fb7ff0000000000000", - "roundtrip": false, - "diagnostic": "Infinity" + "hex": "fb7ff0000000000000" }, { "cbor": "+3/4AAAAAAAA", - "hex": "fb7ff8000000000000", - "roundtrip": false, - "diagnostic": "NaN" + "hex": "fb7ff8000000000000" }, { "cbor": "+//wAAAAAAAA", - "hex": "fbfff0000000000000", - "roundtrip": false, - "diagnostic": "-Infinity" + "hex": "fbfff0000000000000" }, { "cbor": "9A==", - "hex": "f4", - "roundtrip": true, - "decoded": false + "hex": "f4" }, { "cbor": "9Q==", - "hex": "f5", - "roundtrip": true, - "decoded": true + "hex": "f5" }, { "cbor": "9g==", - "hex": "f6", - "roundtrip": true, - "decoded": null + "hex": "f6" }, { "cbor": "9w==", - "hex": "f7", - "roundtrip": true, - "diagnostic": "undefined" + "hex": "f7" }, { "cbor": "8A==", - "hex": "f0", - "roundtrip": true, - "diagnostic": "simple(16)" + "hex": "f0" }, { "cbor": "+P8=", - "hex": "f8ff", - "roundtrip": true, - "diagnostic": "simple(255)" + "hex": "f8ff" }, { "cbor": "wHQyMDEzLTAzLTIxVDIwOjA0OjAwWg==", - "hex": "c074323031332d30332d32315432303a30343a30305a", - "roundtrip": true, - "diagnostic": "0(\"2013-03-21T20:04:00Z\")" + "hex": "c074323031332d30332d32315432303a30343a30305a" }, { "cbor": "wRpRS2ew", - "hex": "c11a514b67b0", - "roundtrip": true, - "diagnostic": "1(1363896240)" + "hex": "c11a514b67b0" }, { "cbor": "wftB1FLZ7CAAAA==", - "hex": "c1fb41d452d9ec200000", - "roundtrip": true, - "diagnostic": "1(1363896240.5)" + "hex": "c1fb41d452d9ec200000" }, { "cbor": "10QBAgME", - "hex": "d74401020304", - "roundtrip": true, - "diagnostic": "23(h'01020304')" + "hex": "d74401020304" }, { "cbor": "2BhFZElFVEY=", - "hex": "d818456449455446", - "roundtrip": true, - "diagnostic": "24(h'6449455446')" + "hex": "d818456449455446" }, { "cbor": "2CB2aHR0cDovL3d3dy5leGFtcGxlLmNvbQ==", - "hex": "d82076687474703a2f2f7777772e6578616d706c652e636f6d", - "roundtrip": true, - "diagnostic": "32(\"http://www.example.com\")" + "hex": "d82076687474703a2f2f7777772e6578616d706c652e636f6d" }, { "cbor": "QA==", - "hex": "40", - "roundtrip": true, - "diagnostic": "h''" + "hex": "40" }, { "cbor": "RAECAwQ=", - "hex": "4401020304", - "roundtrip": true, - "diagnostic": "h'01020304'" + "hex": "4401020304" }, { "cbor": "YA==", - "hex": "60", - "roundtrip": true, - "decoded": "" + "hex": "60" }, { "cbor": "YWE=", - "hex": "6161", - "roundtrip": true, - "decoded": "a" + "hex": "6161" }, { "cbor": "ZElFVEY=", - "hex": "6449455446", - "roundtrip": true, - "decoded": "IETF" + "hex": "6449455446" }, { "cbor": "YiJc", - "hex": "62225c", - "roundtrip": true, - "decoded": "\"\\" + "hex": "62225c" }, { "cbor": "YsO8", - "hex": "62c3bc", - "roundtrip": true, - "decoded": "ü" + "hex": "62c3bc" }, { "cbor": "Y+awtA==", - "hex": "63e6b0b4", - "roundtrip": true, - "decoded": "水" + "hex": "63e6b0b4" }, { "cbor": "ZPCQhZE=", - "hex": "64f0908591", - "roundtrip": true, - "decoded": "𐅑" + "hex": "64f0908591" }, { "cbor": "gA==", - "hex": "80", - "roundtrip": true, - "decoded": [ - - ] + "hex": "80" }, { "cbor": "gwECAw==", - "hex": "83010203", - "roundtrip": true, - "decoded": [ - 1, - 2, - 3 - ] + "hex": "83010203" }, { "cbor": "gwGCAgOCBAU=", - "hex": "8301820203820405", - "roundtrip": true, - "decoded": [ - 1, - [ - 2, - 3 - ], - [ - 4, - 5 - ] - ] + "hex": "8301820203820405" }, { "cbor": "mBkBAgMEBQYHCAkKCwwNDg8QERITFBUWFxgYGBk=", - "hex": "98190102030405060708090a0b0c0d0e0f101112131415161718181819", - "roundtrip": true, - "decoded": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25 - ] + "hex": "98190102030405060708090a0b0c0d0e0f101112131415161718181819" }, { "cbor": "oA==", - "hex": "a0", - "roundtrip": true, - "decoded": { - } + "hex": "a0" }, { "cbor": "ogECAwQ=", - "hex": "a201020304", - "roundtrip": true, - "diagnostic": "{1: 2, 3: 4}" + "hex": "a201020304" }, { "cbor": "omFhAWFiggID", - "hex": "a26161016162820203", - "roundtrip": true, - "decoded": { - "a": 1, - "b": [ - 2, - 3 - ] - } + "hex": "a26161016162820203" }, { "cbor": "gmFhoWFiYWM=", - "hex": "826161a161626163", - "roundtrip": true, - "decoded": [ - "a", - { - "b": "c" - } - ] + "hex": "826161a161626163" }, { "cbor": "pWFhYUFhYmFCYWNhQ2FkYURhZWFF", - "hex": "a56161614161626142616361436164614461656145", - "roundtrip": true, - "decoded": { - "a": "A", - "b": "B", - "c": "C", - "d": "D", - "e": "E" - } + "hex": "a56161614161626142616361436164614461656145" }, { "cbor": "X0IBAkMDBAX/", - "hex": "5f42010243030405ff", - "roundtrip": false, - "diagnostic": "(_ h'0102', h'030405')" + "hex": "5f42010243030405ff" }, { "cbor": "f2VzdHJlYWRtaW5n/w==", - "hex": "7f657374726561646d696e67ff", - "roundtrip": false, - "decoded": "streaming" + "hex": "7f657374726561646d696e67ff" }, { "cbor": "n/8=", - "hex": "9fff", - "roundtrip": false, - "decoded": [ - - ] + "hex": "9fff" }, { "cbor": "nwGCAgOfBAX//w==", - "hex": "9f018202039f0405ffff", - "roundtrip": false, - "decoded": [ - 1, - [ - 2, - 3 - ], - [ - 4, - 5 - ] - ] + "hex": "9f018202039f0405ffff" }, { "cbor": "nwGCAgOCBAX/", - "hex": "9f01820203820405ff", - "roundtrip": false, - "decoded": [ - 1, - [ - 2, - 3 - ], - [ - 4, - 5 - ] - ] + "hex": "9f01820203820405ff" }, { "cbor": "gwGCAgOfBAX/", - "hex": "83018202039f0405ff", - "roundtrip": false, - "decoded": [ - 1, - [ - 2, - 3 - ], - [ - 4, - 5 - ] - ] + "hex": "83018202039f0405ff" }, { "cbor": "gwGfAgP/ggQF", - "hex": "83019f0203ff820405", - "roundtrip": false, - "decoded": [ - 1, - [ - 2, - 3 - ], - [ - 4, - 5 - ] - ] + "hex": "83019f0203ff820405" }, { "cbor": "nwECAwQFBgcICQoLDA0ODxAREhMUFRYXGBgYGf8=", - "hex": "9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff", - "roundtrip": false, - "decoded": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25 - ] + "hex": "9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff" }, { "cbor": "v2FhAWFinwID//8=", - "hex": "bf61610161629f0203ffff", - "roundtrip": false, - "decoded": { - "a": 1, - "b": [ - 2, - 3 - ] - } + "hex": "bf61610161629f0203ffff" }, { "cbor": "gmFhv2FiYWP/", - "hex": "826161bf61626163ff", - "roundtrip": false, - "decoded": [ - "a", - { - "b": "c" - } - ] + "hex": "826161bf61626163ff" }, { "cbor": "v2NGdW71Y0FtdCH/", - "hex": "bf6346756ef563416d7421ff", - "roundtrip": false, - "decoded": { - "Fun": true, - "Amt": -2 - } + "hex": "bf6346756ef563416d7421ff" } ]