mirror of
https://github.com/JonasunderscoreJones/api.jonasjones.dev.git
synced 2025-10-23 20:19:19 +02:00
Initial commit (by create-cloudflare CLI)
This commit is contained in:
commit
58a42872a0
1745 changed files with 741893 additions and 0 deletions
25
node_modules/blake3-wasm/esm/browser/hash-reader.js
generated
vendored
Normal file
25
node_modules/blake3-wasm/esm/browser/hash-reader.js
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { BaseHashReader } from '../base/hash-reader.js';
|
||||
import { Hash } from './hash.js';
|
||||
import { defaultHashLength } from '../base/index.js';
|
||||
/**
|
||||
* A hash reader for WebAssembly targets.
|
||||
*/
|
||||
export class BrowserHashReader extends 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(defaultHashLength);
|
||||
}
|
||||
alloc(bytes) {
|
||||
return new Hash(bytes);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=hash-reader.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue