v / vlib / encoding / cbor / tests / appendix_a.json
636 lines · 634 sloc · 10.08 KB · 468855eef1db0ff73c62be2d1bf176ffa0e1478e
Raw
1[
2 {
3 "cbor": "AA==",
4 "hex": "00",
5 "roundtrip": true,
6 "decoded": 0
7 },
8 {
9 "cbor": "AQ==",
10 "hex": "01",
11 "roundtrip": true,
12 "decoded": 1
13 },
14 {
15 "cbor": "Cg==",
16 "hex": "0a",
17 "roundtrip": true,
18 "decoded": 10
19 },
20 {
21 "cbor": "Fw==",
22 "hex": "17",
23 "roundtrip": true,
24 "decoded": 23
25 },
26 {
27 "cbor": "GBg=",
28 "hex": "1818",
29 "roundtrip": true,
30 "decoded": 24
31 },
32 {
33 "cbor": "GBk=",
34 "hex": "1819",
35 "roundtrip": true,
36 "decoded": 25
37 },
38 {
39 "cbor": "GGQ=",
40 "hex": "1864",
41 "roundtrip": true,
42 "decoded": 100
43 },
44 {
45 "cbor": "GQPo",
46 "hex": "1903e8",
47 "roundtrip": true,
48 "decoded": 1000
49 },
50 {
51 "cbor": "GgAPQkA=",
52 "hex": "1a000f4240",
53 "roundtrip": true,
54 "decoded": 1000000
55 },
56 {
57 "cbor": "GwAAAOjUpRAA",
58 "hex": "1b000000e8d4a51000",
59 "roundtrip": true,
60 "decoded": 1000000000000
61 },
62 {
63 "cbor": "G///////////",
64 "hex": "1bffffffffffffffff",
65 "roundtrip": true,
66 "decoded": 18446744073709551615
67 },
68 {
69 "cbor": "wkkBAAAAAAAAAAA=",
70 "hex": "c249010000000000000000",
71 "roundtrip": true,
72 "decoded": 18446744073709551616
73 },
74 {
75 "cbor": "O///////////",
76 "hex": "3bffffffffffffffff",
77 "roundtrip": true,
78 "decoded": -18446744073709551616
79 },
80 {
81 "cbor": "w0kBAAAAAAAAAAA=",
82 "hex": "c349010000000000000000",
83 "roundtrip": true,
84 "decoded": -18446744073709551617
85 },
86 {
87 "cbor": "IA==",
88 "hex": "20",
89 "roundtrip": true,
90 "decoded": -1
91 },
92 {
93 "cbor": "KQ==",
94 "hex": "29",
95 "roundtrip": true,
96 "decoded": -10
97 },
98 {
99 "cbor": "OGM=",
100 "hex": "3863",
101 "roundtrip": true,
102 "decoded": -100
103 },
104 {
105 "cbor": "OQPn",
106 "hex": "3903e7",
107 "roundtrip": true,
108 "decoded": -1000
109 },
110 {
111 "cbor": "+QAA",
112 "hex": "f90000",
113 "roundtrip": true,
114 "decoded": 0.0
115 },
116 {
117 "cbor": "+YAA",
118 "hex": "f98000",
119 "roundtrip": true,
120 "decoded": -0.0
121 },
122 {
123 "cbor": "+TwA",
124 "hex": "f93c00",
125 "roundtrip": true,
126 "decoded": 1.0
127 },
128 {
129 "cbor": "+z/xmZmZmZma",
130 "hex": "fb3ff199999999999a",
131 "roundtrip": true,
132 "decoded": 1.1
133 },
134 {
135 "cbor": "+T4A",
136 "hex": "f93e00",
137 "roundtrip": true,
138 "decoded": 1.5
139 },
140 {
141 "cbor": "+Xv/",
142 "hex": "f97bff",
143 "roundtrip": true,
144 "decoded": 65504.0
145 },
146 {
147 "cbor": "+kfDUAA=",
148 "hex": "fa47c35000",
149 "roundtrip": true,
150 "decoded": 100000.0
151 },
152 {
153 "cbor": "+n9///8=",
154 "hex": "fa7f7fffff",
155 "roundtrip": true,
156 "decoded": 3.4028234663852886e+38
157 },
158 {
159 "cbor": "+3435DyIAHWc",
160 "hex": "fb7e37e43c8800759c",
161 "roundtrip": true,
162 "decoded": 1.0e+300
163 },
164 {
165 "cbor": "+QAB",
166 "hex": "f90001",
167 "roundtrip": true,
168 "decoded": 5.960464477539063e-08
169 },
170 {
171 "cbor": "+QQA",
172 "hex": "f90400",
173 "roundtrip": true,
174 "decoded": 6.103515625e-05
175 },
176 {
177 "cbor": "+cQA",
178 "hex": "f9c400",
179 "roundtrip": true,
180 "decoded": -4.0
181 },
182 {
183 "cbor": "+8AQZmZmZmZm",
184 "hex": "fbc010666666666666",
185 "roundtrip": true,
186 "decoded": -4.1
187 },
188 {
189 "cbor": "+XwA",
190 "hex": "f97c00",
191 "roundtrip": true,
192 "diagnostic": "Infinity"
193 },
194 {
195 "cbor": "+X4A",
196 "hex": "f97e00",
197 "roundtrip": true,
198 "diagnostic": "NaN"
199 },
200 {
201 "cbor": "+fwA",
202 "hex": "f9fc00",
203 "roundtrip": true,
204 "diagnostic": "-Infinity"
205 },
206 {
207 "cbor": "+n+AAAA=",
208 "hex": "fa7f800000",
209 "roundtrip": false,
210 "diagnostic": "Infinity"
211 },
212 {
213 "cbor": "+n/AAAA=",
214 "hex": "fa7fc00000",
215 "roundtrip": false,
216 "diagnostic": "NaN"
217 },
218 {
219 "cbor": "+v+AAAA=",
220 "hex": "faff800000",
221 "roundtrip": false,
222 "diagnostic": "-Infinity"
223 },
224 {
225 "cbor": "+3/wAAAAAAAA",
226 "hex": "fb7ff0000000000000",
227 "roundtrip": false,
228 "diagnostic": "Infinity"
229 },
230 {
231 "cbor": "+3/4AAAAAAAA",
232 "hex": "fb7ff8000000000000",
233 "roundtrip": false,
234 "diagnostic": "NaN"
235 },
236 {
237 "cbor": "+//wAAAAAAAA",
238 "hex": "fbfff0000000000000",
239 "roundtrip": false,
240 "diagnostic": "-Infinity"
241 },
242 {
243 "cbor": "9A==",
244 "hex": "f4",
245 "roundtrip": true,
246 "decoded": false
247 },
248 {
249 "cbor": "9Q==",
250 "hex": "f5",
251 "roundtrip": true,
252 "decoded": true
253 },
254 {
255 "cbor": "9g==",
256 "hex": "f6",
257 "roundtrip": true,
258 "decoded": null
259 },
260 {
261 "cbor": "9w==",
262 "hex": "f7",
263 "roundtrip": true,
264 "diagnostic": "undefined"
265 },
266 {
267 "cbor": "8A==",
268 "hex": "f0",
269 "roundtrip": true,
270 "diagnostic": "simple(16)"
271 },
272 {
273 "cbor": "+Bg=",
274 "hex": "f818",
275 "roundtrip": true,
276 "diagnostic": "simple(24)"
277 },
278 {
279 "cbor": "+P8=",
280 "hex": "f8ff",
281 "roundtrip": true,
282 "diagnostic": "simple(255)"
283 },
284 {
285 "cbor": "wHQyMDEzLTAzLTIxVDIwOjA0OjAwWg==",
286 "hex": "c074323031332d30332d32315432303a30343a30305a",
287 "roundtrip": true,
288 "diagnostic": "0(\"2013-03-21T20:04:00Z\")"
289 },
290 {
291 "cbor": "wRpRS2ew",
292 "hex": "c11a514b67b0",
293 "roundtrip": true,
294 "diagnostic": "1(1363896240)"
295 },
296 {
297 "cbor": "wftB1FLZ7CAAAA==",
298 "hex": "c1fb41d452d9ec200000",
299 "roundtrip": true,
300 "diagnostic": "1(1363896240.5)"
301 },
302 {
303 "cbor": "10QBAgME",
304 "hex": "d74401020304",
305 "roundtrip": true,
306 "diagnostic": "23(h'01020304')"
307 },
308 {
309 "cbor": "2BhFZElFVEY=",
310 "hex": "d818456449455446",
311 "roundtrip": true,
312 "diagnostic": "24(h'6449455446')"
313 },
314 {
315 "cbor": "2CB2aHR0cDovL3d3dy5leGFtcGxlLmNvbQ==",
316 "hex": "d82076687474703a2f2f7777772e6578616d706c652e636f6d",
317 "roundtrip": true,
318 "diagnostic": "32(\"http://www.example.com\")"
319 },
320 {
321 "cbor": "QA==",
322 "hex": "40",
323 "roundtrip": true,
324 "diagnostic": "h''"
325 },
326 {
327 "cbor": "RAECAwQ=",
328 "hex": "4401020304",
329 "roundtrip": true,
330 "diagnostic": "h'01020304'"
331 },
332 {
333 "cbor": "YA==",
334 "hex": "60",
335 "roundtrip": true,
336 "decoded": ""
337 },
338 {
339 "cbor": "YWE=",
340 "hex": "6161",
341 "roundtrip": true,
342 "decoded": "a"
343 },
344 {
345 "cbor": "ZElFVEY=",
346 "hex": "6449455446",
347 "roundtrip": true,
348 "decoded": "IETF"
349 },
350 {
351 "cbor": "YiJc",
352 "hex": "62225c",
353 "roundtrip": true,
354 "decoded": "\"\\"
355 },
356 {
357 "cbor": "YsO8",
358 "hex": "62c3bc",
359 "roundtrip": true,
360 "decoded": "ü"
361 },
362 {
363 "cbor": "Y+awtA==",
364 "hex": "63e6b0b4",
365 "roundtrip": true,
366 "decoded": "水"
367 },
368 {
369 "cbor": "ZPCQhZE=",
370 "hex": "64f0908591",
371 "roundtrip": true,
372 "decoded": "𐅑"
373 },
374 {
375 "cbor": "gA==",
376 "hex": "80",
377 "roundtrip": true,
378 "decoded": [
379
380 ]
381 },
382 {
383 "cbor": "gwECAw==",
384 "hex": "83010203",
385 "roundtrip": true,
386 "decoded": [
387 1,
388 2,
389 3
390 ]
391 },
392 {
393 "cbor": "gwGCAgOCBAU=",
394 "hex": "8301820203820405",
395 "roundtrip": true,
396 "decoded": [
397 1,
398 [
399 2,
400 3
401 ],
402 [
403 4,
404 5
405 ]
406 ]
407 },
408 {
409 "cbor": "mBkBAgMEBQYHCAkKCwwNDg8QERITFBUWFxgYGBk=",
410 "hex": "98190102030405060708090a0b0c0d0e0f101112131415161718181819",
411 "roundtrip": true,
412 "decoded": [
413 1,
414 2,
415 3,
416 4,
417 5,
418 6,
419 7,
420 8,
421 9,
422 10,
423 11,
424 12,
425 13,
426 14,
427 15,
428 16,
429 17,
430 18,
431 19,
432 20,
433 21,
434 22,
435 23,
436 24,
437 25
438 ]
439 },
440 {
441 "cbor": "oA==",
442 "hex": "a0",
443 "roundtrip": true,
444 "decoded": {
445 }
446 },
447 {
448 "cbor": "ogECAwQ=",
449 "hex": "a201020304",
450 "roundtrip": true,
451 "diagnostic": "{1: 2, 3: 4}"
452 },
453 {
454 "cbor": "omFhAWFiggID",
455 "hex": "a26161016162820203",
456 "roundtrip": true,
457 "decoded": {
458 "a": 1,
459 "b": [
460 2,
461 3
462 ]
463 }
464 },
465 {
466 "cbor": "gmFhoWFiYWM=",
467 "hex": "826161a161626163",
468 "roundtrip": true,
469 "decoded": [
470 "a",
471 {
472 "b": "c"
473 }
474 ]
475 },
476 {
477 "cbor": "pWFhYUFhYmFCYWNhQ2FkYURhZWFF",
478 "hex": "a56161614161626142616361436164614461656145",
479 "roundtrip": true,
480 "decoded": {
481 "a": "A",
482 "b": "B",
483 "c": "C",
484 "d": "D",
485 "e": "E"
486 }
487 },
488 {
489 "cbor": "X0IBAkMDBAX/",
490 "hex": "5f42010243030405ff",
491 "roundtrip": false,
492 "diagnostic": "(_ h'0102', h'030405')"
493 },
494 {
495 "cbor": "f2VzdHJlYWRtaW5n/w==",
496 "hex": "7f657374726561646d696e67ff",
497 "roundtrip": false,
498 "decoded": "streaming"
499 },
500 {
501 "cbor": "n/8=",
502 "hex": "9fff",
503 "roundtrip": false,
504 "decoded": [
505
506 ]
507 },
508 {
509 "cbor": "nwGCAgOfBAX//w==",
510 "hex": "9f018202039f0405ffff",
511 "roundtrip": false,
512 "decoded": [
513 1,
514 [
515 2,
516 3
517 ],
518 [
519 4,
520 5
521 ]
522 ]
523 },
524 {
525 "cbor": "nwGCAgOCBAX/",
526 "hex": "9f01820203820405ff",
527 "roundtrip": false,
528 "decoded": [
529 1,
530 [
531 2,
532 3
533 ],
534 [
535 4,
536 5
537 ]
538 ]
539 },
540 {
541 "cbor": "gwGCAgOfBAX/",
542 "hex": "83018202039f0405ff",
543 "roundtrip": false,
544 "decoded": [
545 1,
546 [
547 2,
548 3
549 ],
550 [
551 4,
552 5
553 ]
554 ]
555 },
556 {
557 "cbor": "gwGfAgP/ggQF",
558 "hex": "83019f0203ff820405",
559 "roundtrip": false,
560 "decoded": [
561 1,
562 [
563 2,
564 3
565 ],
566 [
567 4,
568 5
569 ]
570 ]
571 },
572 {
573 "cbor": "nwECAwQFBgcICQoLDA0ODxAREhMUFRYXGBgYGf8=",
574 "hex": "9f0102030405060708090a0b0c0d0e0f101112131415161718181819ff",
575 "roundtrip": false,
576 "decoded": [
577 1,
578 2,
579 3,
580 4,
581 5,
582 6,
583 7,
584 8,
585 9,
586 10,
587 11,
588 12,
589 13,
590 14,
591 15,
592 16,
593 17,
594 18,
595 19,
596 20,
597 21,
598 22,
599 23,
600 24,
601 25
602 ]
603 },
604 {
605 "cbor": "v2FhAWFinwID//8=",
606 "hex": "bf61610161629f0203ffff",
607 "roundtrip": false,
608 "decoded": {
609 "a": 1,
610 "b": [
611 2,
612 3
613 ]
614 }
615 },
616 {
617 "cbor": "gmFhv2FiYWP/",
618 "hex": "826161bf61626163ff",
619 "roundtrip": false,
620 "decoded": [
621 "a",
622 {
623 "b": "c"
624 }
625 ]
626 },
627 {
628 "cbor": "v2NGdW71Y0FtdCH/",
629 "hex": "bf6346756ef563416d7421ff",
630 "roundtrip": false,
631 "decoded": {
632 "Fun": true,
633 "Amt": -2
634 }
635 }
636]
637