]> git.codecow.com Git - libnemo.git/commitdiff
Delete redundant Tools.hash function, just use exported Blake2b directly.
authorChris Duncan <chris@codecow.com>
Mon, 29 Jun 2026 19:31:06 +0000 (12:31 -0700)
committerChris Duncan <chris@codecow.com>
Mon, 29 Jun 2026 19:31:06 +0000 (12:31 -0700)
package-lock.json
src/lib/tools.ts

index 4cf9be7ba8de4fe8f91e39d12c4b72bc96014e4f..01f25f48d1da45bdbac6b576e12c25667dacb083 100644 (file)
                        }
                },
                "node_modules/bare-os": {
-                       "version": "3.9.1",
-                       "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.9.1.tgz",
-                       "integrity": "sha512-6M5XjcnsygQNPMCMPXSK379xrJFiZ/AEMNBmFEmQW8d/789VQATvriyi5r0HYTL9TkQ26rn3kgdTG3aisbrXkQ==",
+                       "version": "3.9.3",
+                       "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.9.3.tgz",
+                       "integrity": "sha512-fF4Q7QsyKVF5Rj0qvI8BgUNjqzC2JvQlpTaPLjVJVxYVUX5Zr9un+y3w1HmA4nNKdFmRBT8z/WmrjvXzXVerKQ==",
                        "license": "Apache-2.0",
                        "optional": true,
                        "engines": {
                        "optional": true
                },
                "node_modules/js-yaml": {
-                       "version": "4.2.0",
-                       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
-                       "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
+                       "version": "4.3.0",
+                       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz",
+                       "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==",
                        "funding": [
                                {
                                        "type": "github",
                        }
                },
                "node_modules/tar-fs": {
-                       "version": "3.1.2",
-                       "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.2.tgz",
-                       "integrity": "sha512-QGxxTxxyleAdyM3kpFs14ymbYmNFrfY+pHj7Z8FgtbZ7w2//VAgLMac7sT6nRpIHjppXO2AwwEOg0bPFVRcmXw==",
+                       "version": "3.1.3",
+                       "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.3.tgz",
+                       "integrity": "sha512-/hU4AXnIdZu+Gvl1pk0oI5f5HxWsCJRtY2aFaJdk9VvyL48DWU6iU5WAIPG+wIi1YvWA6eTJvIviP/tMAZZNwQ==",
                        "license": "MIT",
                        "optional": true,
                        "dependencies": {
index e95f0c59fc09bf1fe0293476dc1a2aaebaceb2ef..24a5e902b259d7d04fe0483204f714b71ae3df48 100644 (file)
@@ -6,7 +6,6 @@ import { Account } from './account'
 import { Block } from './block'
 import { MAX_SUPPLY, UNITS } from './constants'
 import { bytes, hex, utf8 } from './convert'
-import { Blake2b } from './crypto'
 import { Rpc } from './rpc'
 import { Wallet } from './wallet'
 
@@ -109,34 +108,6 @@ export class Tools {
                }
        }
 
-       /**
-        * Hashes one or more arbitrary strings to a 32-byte value using BLAKE2b.
-        *
-        * @param {(string|string[])} data String(s) to hash
-        * @param {string} [encoding] Interprets input strings as hexadecimal values if 'hex' is passed, else UTF-8
-        */
-       static hash (data: string | string[], encoding?: 'hex'): Uint8Array<ArrayBuffer>
-       /**
-        * Hashes one or more arbitrary strings to a 32-byte value using BLAKE2b.
-        *
-        * @param {(string|string[])} data String(s) to hash
-        * @param {string} [encoding] Interprets input strings as hexadecimal values if 'hex' is passed, else UTF-8
-        * @param {string} [format] Formats output as a hexadecimal value if 'hex' is passed, else Uint8Array<ArrayBuffer>
-        */
-       static hash (data: string | string[], encoding?: 'hex', format?: 'hex'): string | Uint8Array<ArrayBuffer> {
-               if (!Array.isArray(data)) data = [data]
-               const hash = new Blake2b(32)
-               if (encoding === 'hex') {
-                       data.forEach(str => hash.update(hex.toBytes(str)))
-               } else {
-                       const enc = new TextEncoder()
-                       data.forEach(str => hash.update(enc.encode(str)))
-               }
-               return format === 'hex'
-                       ? bytes.toHex(hash.digest())
-                       : hash.digest()
-       }
-
        /**
         * Signs an arbitrary string with a secret key using nano25519. The input data
         * is encoded as UTF-8 and can be up to 32 KiB in total.