(bytes: Uint8Array, offset: number, value: number)
| 94 | |
| 95 | /** Writes an int64, given a value the caller has checked fits a double exactly. */ |
| 96 | const writeInt64 = (bytes: Uint8Array, offset: number, value: number): void => { |
| 97 | const high = Math.floor(value / 4294967296) |
| 98 | writeInt32(bytes, offset, high) |
| 99 | writeInt32(bytes, offset + 4, value - high * 4294967296) |
| 100 | } |
| 101 | |
| 102 | const readUint32 = (bytes: Uint8Array, offset: number): number => |
| 103 | ((bytes[offset] << 24) | (bytes[offset + 1] << 16) | (bytes[offset + 2] << 8) | bytes[offset + 3]) >>> 0 |