zcash-primitives-js/test/fixtures/bufferutils.json

102 lines
2.0 KiB
JSON

{
"valid": [
{
"dec": 0,
"hex64": "0000000000000000"
},
{
"dec": 1,
"hex64": "0100000000000000"
},
{
"dec": 252,
"hex64": "fc00000000000000"
},
{
"dec": 253,
"hex64": "fd00000000000000"
},
{
"dec": 254,
"hex64": "fe00000000000000"
},
{
"dec": 255,
"hex64": "ff00000000000000"
},
{
"dec": 65534,
"hex64": "feff000000000000"
},
{
"dec": 65535,
"hex64": "ffff000000000000"
},
{
"dec": 65536,
"hex64": "0000010000000000"
},
{
"dec": 65537,
"hex64": "0100010000000000"
},
{
"dec": 4294967295,
"hex64": "ffffffff00000000"
},
{
"dec": 4294967296,
"hex64": "0000000001000000"
},
{
"dec": 4294967297,
"hex64": "0100000001000000"
},
{
"dec": 9007199254740991,
"hex64": "ffffffffffff1f00"
}
],
"invalid": {
"readUInt64LE": [
{
"description": "n === 2^53",
"exception": "RangeError: value out of range",
"hex64": "0000000000002000"
},
{
"description": "n > 2^53",
"exception": "RangeError: value out of range",
"hex64": "0100000000002000"
}
],
"writeUInt64LE": [
{
"description": "n not a number",
"exception": "cannot write a non-number as a number",
"dec": "foo"
},
{
"description": "n < 0",
"exception": "specified a negative value for writing an unsigned value",
"dec": -1
},
{
"description": "n === 2^53",
"exception": "RangeError: value out of range",
"dec": 9007199254740992
},
{
"description": "n > 2^53",
"exception": "RangeError: value out of range",
"dec": 9007199254740993
},
{
"description": "floor(n) !== n",
"exception": "value has a fractional component",
"dec": 1.5
}
]
}
}