static #MIN: 16 = 16
static #MAX: 32 = 32
static #MOD: 4 = 4
+ #bigint?: bigint
#bytes: Uint8Array<ArrayBuffer>
+ get bigint (): bigint {
+ if (this.#bigint == null) {
+ this.#bigint = 0n
+ for (let i = 0; i < this.#bytes.byteLength; i++) {
+ this.#bigint <<= 8n
+ this.#bigint |= BigInt(this.#bytes[i])
+ }
+ }
+ return this.#bigint
+ }
get bits (): string { return bytes.toBin(this.#bytes) }
get buffer (): ArrayBuffer { return this.#bytes.buffer }
get bytes (): Uint8Array<ArrayBuffer> { return this.#bytes }