nim-serde/tests/cbor/test_vector.json

685 lines
12 KiB
JSON

[
{
"cbor": "AA==",
"hex": "00",
"roundtrip": true,
"decoded": 0,
"name": "uint_0"
},
{
"cbor": "AQ==",
"hex": "01",
"roundtrip": true,
"decoded": 1,
"name": "uint_1"
},
{
"cbor": "Cg==",
"hex": "0a",
"roundtrip": true,
"decoded": 10,
"name": "uint_10"
},
{
"cbor": "Fw==",
"hex": "17",
"roundtrip": true,
"decoded": 23,
"name": "uint_23"
},
{
"cbor": "GBg=",
"hex": "1818",
"roundtrip": true,
"decoded": 24,
"name": "uint_24"
},
{
"cbor": "GBk=",
"hex": "1819",
"roundtrip": true,
"decoded": 25,
"name": "uint_25"
},
{
"cbor": "GGQ=",
"hex": "1864",
"roundtrip": true,
"decoded": 100,
"name": "uint_100"
},
{
"cbor": "GQPo",
"hex": "1903e8",
"roundtrip": true,
"decoded": 1000,
"name": "uint_1000"
},
{
"cbor": "GgAPQkA=",
"hex": "1a000f4240",
"roundtrip": true,
"decoded": 1000000,
"name": "uint_1000000"
},
{
"cbor": "GwAAAOjUpRAA",
"hex": "1b000000e8d4a51000",
"roundtrip": true,
"decoded": 1000000000000,
"name": "uint_1000000000000"
},
{
"cbor": "IA==",
"hex": "20",
"roundtrip": true,
"decoded": -1,
"name": "nint_1"
},
{
"cbor": "KQ==",
"hex": "29",
"roundtrip": true,
"decoded": -10,
"name": "nint_10"
},
{
"cbor": "OGM=",
"hex": "3863",
"roundtrip": true,
"decoded": -100,
"name": "nint_100"
},
{
"cbor": "OQPn",
"hex": "3903e7",
"roundtrip": true,
"decoded": -1000,
"name": "nint_1000"
},
{
"cbor": "+QAA",
"hex": "f90000",
"roundtrip": true,
"decoded": 0.0,
"name": "float16_0"
},
{
"cbor": "+YAA",
"hex": "f98000",
"roundtrip": true,
"decoded": -0.0,
"name": "float16_neg0"
},
{
"cbor": "+TwA",
"hex": "f93c00",
"roundtrip": true,
"decoded": 1.0,
"name": "float16_1"
},
{
"cbor": "+z/xmZmZmZma",
"hex": "fb3ff199999999999a",
"roundtrip": true,
"decoded": 1.1,
"name": "float64_1_1"
},
{
"cbor": "+T4A",
"hex": "f93e00",
"roundtrip": true,
"decoded": 1.5,
"name": "float16_1_5"
},
{
"cbor": "+Xv/",
"hex": "f97bff",
"roundtrip": true,
"decoded": 65504.0,
"name": "float16_65504"
},
{
"cbor": "+kfDUAA=",
"hex": "fa47c35000",
"roundtrip": true,
"decoded": 100000.0,
"name": "float32_100000"
},
{
"cbor": "+n9///8=",
"hex": "fa7f7fffff",
"roundtrip": true,
"decoded": 3.4028234663852886e+38,
"name": "float32_max"
},
{
"cbor": "+3435DyIAHWc",
"hex": "fb7e37e43c8800759c",
"roundtrip": true,
"decoded": 1e+300,
"name": "float64_1e300"
},
{
"cbor": "+QAB",
"hex": "f90001",
"roundtrip": true,
"decoded": 5.960464477539063e-08,
"name": "float16_min"
},
{
"cbor": "+QQA",
"hex": "f90400",
"roundtrip": true,
"decoded": 6.103515625e-05,
"name": "float16_min_exp"
},
{
"cbor": "+cQA",
"hex": "f9c400",
"roundtrip": true,
"decoded": -4.0,
"name": "float32_neg4"
},
{
"cbor": "+8AQZmZmZmZm",
"hex": "fbc010666666666666",
"roundtrip": true,
"decoded": -4.1,
"name": "float64_neg4_1"
},
{
"cbor": "+XwA",
"hex": "f97c00",
"roundtrip": true,
"diagnostic": "Infinity",
"name": "float16_inf"
},
{
"cbor": "+X4A",
"hex": "f97e00",
"roundtrip": true,
"diagnostic": "NaN",
"name": "float16_nan"
},
{
"cbor": "+fwA",
"hex": "f9fc00",
"roundtrip": true,
"diagnostic": "-Infinity",
"name": "float16_neginf"
},
{
"cbor": "+n+AAAA=",
"hex": "fa7f800000",
"roundtrip": false,
"diagnostic": "Infinity",
"name": "float32_inf"
},
{
"cbor": "+n/AAAA=",
"hex": "fa7fc00000",
"roundtrip": false,
"diagnostic": "NaN",
"name": "float32_nan"
},
{
"cbor": "+v+AAAA=",
"hex": "faff800000",
"roundtrip": false,
"diagnostic": "-Infinity",
"name": "float32_neginf"
},
{
"cbor": "+3/wAAAAAAAA",
"hex": "fb7ff0000000000000",
"roundtrip": false,
"diagnostic": "Infinity",
"name": "float64_inf"
},
{
"cbor": "+3/4AAAAAAAA",
"hex": "fb7ff8000000000000",
"roundtrip": false,
"diagnostic": "NaN",
"name": "float64_nan"
},
{
"cbor": "+//wAAAAAAAA",
"hex": "fbfff0000000000000",
"roundtrip": false,
"diagnostic": "-Infinity",
"name": "float64_neginf"
},
{
"cbor": "9A==",
"hex": "f4",
"roundtrip": true,
"decoded": false,
"name": "false"
},
{
"cbor": "9Q==",
"hex": "f5",
"roundtrip": true,
"decoded": true,
"name": "true"
},
{
"cbor": "9g==",
"hex": "f6",
"roundtrip": true,
"decoded": null,
"name": "null"
},
{
"cbor": "9w==",
"hex": "f7",
"roundtrip": true,
"diagnostic": "undefined",
"name": "undefined"
},
{
"cbor": "8A==",
"hex": "f0",
"roundtrip": true,
"diagnostic": "simple(16)",
"name": "simple_16"
},
{
"cbor": "+Bg=",
"hex": "f818",
"roundtrip": true,
"diagnostic": "simple(24)",
"name": "simple_24"
},
{
"cbor": "+P8=",
"hex": "f8ff",
"roundtrip": true,
"diagnostic": "simple(255)",
"name": "simple_255"
},
{
"cbor": "wHQyMDEzLTAzLTIxVDIwOjA0OjAwWg==",
"hex": "c074323031332d30332d32315432303a30343a30305a",
"roundtrip": true,
"diagnostic": "0(\"2013-03-21T20:04:00Z\")",
"name": "tag0_datetime"
},
{
"cbor": "wRpRS2ew",
"hex": "c11a514b67b0",
"roundtrip": true,
"diagnostic": "1(1363896240)",
"name": "tag1_epoch"
},
{
"cbor": "wftB1FLZ7CAAAA==",
"hex": "c1fb41d452d9ec200000",
"roundtrip": true,
"diagnostic": "1(1363896240.5)",
"name": "tag1_epoch_float"
},
{
"cbor": "10QBAgME",
"hex": "d74401020304",
"roundtrip": true,
"diagnostic": "23(h'01020304')",
"name": "tag23_h64"
},
{
"cbor": "2BhFZElFVEY=",
"hex": "d818456449455446",
"roundtrip": true,
"diagnostic": "24(h'6449455446')",
"name": "tag24_b64url"
},
{
"cbor": "2CB2aHR0cDovL3d3dy5leGFtcGxlLmNvbQ==",
"hex": "d82076687474703a2f2f7777772e6578616d706c652e636f6d",
"roundtrip": true,
"diagnostic": "32(\"http://www.example.com\")",
"name": "tag32_uri"
},
{
"cbor": "QA==",
"hex": "40",
"roundtrip": true,
"diagnostic": "h''",
"name": "bstr_empty"
},
{
"cbor": "RAECAwQ=",
"hex": "4401020304",
"roundtrip": true,
"diagnostic": "h'01020304'",
"name": "bstr_bytes"
},
{
"cbor": "YA==",
"hex": "60",
"roundtrip": true,
"decoded": "",
"name": "tstr_empty"
},
{
"cbor": "YWE=",
"hex": "6161",
"roundtrip": true,
"decoded": "a",
"name": "tstr_a"
},
{
"cbor": "ZElFVEY=",
"hex": "6449455446",
"roundtrip": true,
"decoded": "IETF",
"name": "tstr_ietf"
},
{
"cbor": "YiJc",
"hex": "62225c",
"roundtrip": true,
"decoded": "\"\\",
"name": "tstr_escaped"
},
{
"cbor": "YsO8",
"hex": "62c3bc",
"roundtrip": true,
"decoded": "\u00fc",
"name": "tstr_u00fc"
},
{
"cbor": "Y+awtA==",
"hex": "63e6b0b4",
"roundtrip": true,
"decoded": "\u6c34",
"name": "tstr_u6c34"
},
{
"cbor": "ZPCQhZE=",
"hex": "64f0908591",
"roundtrip": true,
"decoded": "\ud800\udd51",
"name": "tstr_u10151"
},
{
"cbor": "gA==",
"hex": "80",
"roundtrip": true,
"decoded": [],
"name": "array_empty"
},
{
"cbor": "gwECAw==",
"hex": "83010203",
"roundtrip": true,
"decoded": [
1,
2,
3
],
"name": "array_123"
},
{
"cbor": "gwGCAgOCBAU=",
"hex": "8301820203820405",
"roundtrip": true,
"decoded": [
1,
[
2,
3
],
[
4,
5
]
],
"name": "array_nested"
},
{
"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
],
"name": "array_25items"
},
{
"cbor": "oA==",
"hex": "a0",
"roundtrip": true,
"decoded": {},
"name": "map_empty"
},
{
"cbor": "ogECAwQ=",
"hex": "a201020304",
"roundtrip": true,
"diagnostic": "{1: 2, 3: 4}",
"name": "map_pairs"
},
{
"cbor": "omFhAWFiggID",
"hex": "a26161016162820203",
"roundtrip": true,
"decoded": {
"a": 1,
"b": [
2,
3
]
},
"name": "map_nested"
},
{
"cbor": "gmFhoWFiYWM=",
"hex": "826161a161626163",
"roundtrip": true,
"decoded": [
"a",
{
"b": "c"
}
],
"name": "map_mixed"
},
{
"cbor": "pWFhYUFhYmFCYWNhQ2FkYURhZWFF",
"hex": "a56161614161626142616361436164614461656145",
"roundtrip": true,
"decoded": {
"a": "A",
"b": "B",
"c": "C",
"d": "D",
"e": "E"
},
"name": "map_strings"
},
{
"cbor": "X0IBAkMDBAX/",
"hex": "5f42010243030405ff",
"roundtrip": false,
"diagnostic": "h'0102030405'",
"name": "indef_tstr"
},
{
"cbor": "f2VzdHJlYWRtaW5n/w==",
"hex": "7f657374726561646d696e67ff",
"roundtrip": false,
"decoded": "streaming",
"name": "indef_array_empty"
},
{
"cbor": "n/8=",
"hex": "9fff",
"roundtrip": false,
"decoded": [],
"name": "indef_array_1"
},
{
"cbor": "nwGCAgOfBAX//w==",
"hex": "9f018202039f0405ffff",
"roundtrip": false,
"decoded": [
1,
[
2,
3
],
[
4,
5
]
],
"name": "indef_array_2"
},
{
"cbor": "nwGCAgOCBAX/",
"hex": "9f01820203820405ff",
"roundtrip": false,
"decoded": [
1,
[
2,
3
],
[
4,
5
]
],
"name": "indef_array_3"
},
{
"cbor": "gwGCAgOfBAX/",
"hex": "83018202039f0405ff",
"roundtrip": false,
"decoded": [
1,
[
2,
3
],
[
4,
5
]
],
"name": "indef_array_4"
},
{
"cbor": "gwGfAgP/ggQF",
"hex": "83019f0203ff820405",
"roundtrip": false,
"decoded": [
1,
[
2,
3
],
[
4,
5
]
],
"name": "indef_array_long"
},
{
"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
],
"name": "indef_map_1"
},
{
"cbor": "v2FhAWFinwID//8=",
"hex": "bf61610161629f0203ffff",
"roundtrip": false,
"decoded": {
"a": 1,
"b": [
2,
3
]
},
"name": "indef_map_2"
},
{
"cbor": "gmFhv2FiYWP/",
"hex": "826161bf61626163ff",
"roundtrip": false,
"decoded": [
"a",
{
"b": "c"
}
],
"name": "indef_map_3"
},
{
"cbor": "v2NGdW71Y0FtdCH/",
"hex": "bf6346756ef563416d7421ff",
"roundtrip": false,
"decoded": {
"Fun": true,
"Amt": -2
},
"name": "indef_map_4"
}
]