]> git.codecow.com Git - libnemo.git/commitdiff
Add convenience getter for entropy as bigint. Add constructor overload for unknown...
authorChris Duncan <chris@zoso.dev>
Mon, 4 Aug 2025 17:54:56 +0000 (10:54 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 4 Aug 2025 17:54:56 +0000 (10:54 -0700)
src/lib/entropy.ts

index bd7736274e541a399800232f94f35b4ef24e4613..5d34ff648bca364f6e9c5099bbc6f627abb9c24a 100644 (file)
@@ -31,6 +31,7 @@ export class Entropy {
        }
        get bits (): string { return bytes.toBin(this.#bytes) }
        get buffer (): ArrayBuffer { return this.#bytes.buffer }
+       get byteLength (): number { return this.#bytes.byteLength }
        get bytes (): Uint8Array<ArrayBuffer> { return this.#bytes }
        get hex (): string { return bytes.toHex(this.#bytes) }
 
@@ -58,6 +59,7 @@ export class Entropy {
        * @param {string} hex - Hexadecimal string
        */
        constructor (hex: string)
+       constructor (input?: unknown)
        constructor (input?: unknown) {
 
                if (input == null) {