mirror of
https://github.com/JonasunderscoreJones/aka-worker.git
synced 2025-10-23 18:09:19 +02:00
Initial commit (by create-cloudflare CLI)
This commit is contained in:
parent
8cb86120f1
commit
fff961078a
1777 changed files with 1011798 additions and 0 deletions
28
cool-dawn-3d3b/node_modules/blake3-wasm/dist/browser/hash-reader.js
generated
vendored
Normal file
28
cool-dawn-3d3b/node_modules/blake3-wasm/dist/browser/hash-reader.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const hash_reader_1 = require("../base/hash-reader");
|
||||
const hash_1 = require("./hash");
|
||||
const index_1 = require("../base/index");
|
||||
/**
|
||||
* A hash reader for WebAssembly targets.
|
||||
*/
|
||||
class BrowserHashReader extends hash_reader_1.BaseHashReader {
|
||||
/**
|
||||
* Converts first 32 bytes of the hash to a string with the given encoding.
|
||||
*/
|
||||
toString(encoding = 'hex') {
|
||||
return this.toArray().toString(encoding);
|
||||
}
|
||||
/**
|
||||
* Converts first 32 bytes of the hash to an array.
|
||||
*/
|
||||
toArray() {
|
||||
this.position = BigInt(0);
|
||||
return this.read(index_1.defaultHashLength);
|
||||
}
|
||||
alloc(bytes) {
|
||||
return new hash_1.Hash(bytes);
|
||||
}
|
||||
}
|
||||
exports.BrowserHashReader = BrowserHashReader;
|
||||
//# sourceMappingURL=hash-reader.js.map
|
Loading…
Add table
Add a link
Reference in a new issue