Download worker/node_modules/blake3-wasm/esm/node/hash-reader.js from luckyrobots/cv_old: direct link, hf CLI and curl.
- Browser
- Download file 679 Bytes
-
https://huggingface.co/datasets/luckyrobots/cv_old/resolve/main/worker/node_modules/blake3-wasm/esm/node/hash-reader.js
- Command line
-
hf download hf://datasets/luckyrobots/cv_old/worker/node_modules/blake3-wasm/esm/node/hash-reader.js
-
curl -L -o hash-reader.js https://huggingface.co/datasets/luckyrobots/cv_old/resolve/main/worker/node_modules/blake3-wasm/esm/node/hash-reader.js
679 Bytes
| import { BaseHashReader } from '../base/hash-reader.js'; | |
| import { defaultHashLength } from '../base/hash-fn.js'; | |
| /** | |
| * A hash reader for WebAssembly targets. | |
| */ | |
| export class NodeHashReader extends BaseHashReader { | |
| /** | |
| * Converts first 32 bytes of the hash to a string with the given encoding. | |
| */ | |
| toString(encoding = 'hex') { | |
| return this.toBuffer().toString(encoding); | |
| } | |
| /** | |
| * Converts first 32 bytes of the hash to an array. | |
| */ | |
| toBuffer() { | |
| this.position = BigInt(0); | |
| return this.read(defaultHashLength); | |
| } | |
| alloc(bytes) { | |
| return Buffer.alloc(bytes); | |
| } | |
| } | |
| //# sourceMappingURL=hash-reader.js.map |