]> git.codecow.com Git - nano25519.git/commitdiff
Fix static string method and remove unused constants.
authorChris Duncan <chris@codecow.com>
Sat, 10 Oct 2026 05:22:16 +0000 (22:22 -0700)
committerChris Duncan <chris@codecow.com>
Sat, 10 Oct 2026 05:22:16 +0000 (22:22 -0700)
src/lib/primordials.ts

index 636ec12901062e0f4232dfe6109d2eb0a59af28b..8b4d0a41b279f5d009e6cdfb62a1f77a4778fb2f 100644 (file)
@@ -50,8 +50,6 @@ const TypedArray = Object.getPrototypeOf(Bytes.prototype)
 
 const bytesSet = Function.prototype.call.bind(Bytes.prototype.set)
 const bytesFill = Function.prototype.call.bind(Bytes.prototype.fill)
-const charCodeAt = Function.prototype.call.bind(String.prototype.charCodeAt)
-const fromCharCode = Function.prototype.call.bind(String.fromCharCode)
 
 function get<T> (target: object, key: PropertyKey): (this: unknown) => T {
        const found = Object.getOwnPropertyDescriptor(target, key)
@@ -151,13 +149,8 @@ export function words (bytes: Bytes): Words {
        return new Words(getBuffer(bytes) as ArrayBuffer, offset, getByteLength(bytes) >> 2)
 }
 
-const LOWER = '0123456789abcdef'
-const UPPER = '0123456789ABCDEF'
-const NIBBLE: Record<string, number> = Object.create(null)
-for (let i = 0; i < 16; i++) {
-       NIBBLE[LOWER[i]] = i
-       NIBBLE[UPPER[i]] = i
-}
+const charCodeAt = Function.prototype.call.bind(String.prototype.charCodeAt)
+const fromCharCode = String.fromCharCode
 
 /** 0-9a-f for a valid hex digit 0..15 */
 function hexcode (c: number): number {