Commit dfa8569b authored by ZettaScript's avatar ZettaScript
Browse files

Parse int64

parent ba5bc34a
......@@ -20,7 +20,6 @@ Currently, this library only handles parsing. It is very simple:
The following features aren't implemented yet:
* UBJSON encoding
* Parsing type int64
* Parsing type float32
* Parsing type float64
* Parsing type high-precision number
......
......@@ -80,7 +80,8 @@ function ubjson_parse(raw, start=null, marker=null, bin=true) {
break;
case 76: // L: int64
// TODO
start.v += 8;
return BigInt(raw[start.v-8])*0x100000000000000n + BigInt(raw[start.v-7])*0x1000000000000n + BigInt(raw[start.v-6]*0x10000000000 + raw[start.v-5]*0x100000000 + raw[start.v-4]*0x1000000 + raw[start.v-3]*0x10000 + raw[start.v-2]*0x100 + raw[start.v-1]) - 0x10000000000000000n*BigInt(raw[start.v-8]>127);
break;
case 100: // d: float32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment