Large integers within the safe JS integer range can get pushed above the safe JS integer range during zigzag encoding/decoding causing a loss of precision (the zigzag encoded number has a float64 collision so can't be decoded back into the original number).
Large integers within the safe JS integer range can get pushed above the safe JS integer range during zigzag encoding/decoding causing a loss of precision (the zigzag encoded number has a float64 collision so can't be decoded back into the original number).
unsafe zigzag encoding calculation in
Tap.ptototype.writeLong
Since these source numbers are in the safe JS integer range they pass the bounds check for long types
isSafeLong
checks range[Number.MIN_SAFE_INTEGER + 1, Number.MAX_SAFE_INTEGER - 1]
LongType.prototype._check
bounds check usingisSafeLong
LongType.prototype._write
bounds check usingisSafeLong
Here are some examples: