}
},
"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": {
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'
}
}
- /**
- * 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.