download
raw
973 Bytes
import { SHA3XOF } from "./sha3.js";
export function shake128(size, data) {
const hash = new SHAKE128(size);
hash.update(data);
return hash.digest();
}
export function shake256(size, data) {
const hash = new SHAKE256(size);
hash.update(data);
return hash.digest();
}
export class SHAKE128 {
blockSize = 168;
size;
sha3;
constructor(size) {
if (size < 1) {
throw new TypeError("Invalid hash size");
}
this.size = size;
this.sha3 = new SHA3XOF(this.blockSize, this.size);
}
update(data) {
this.sha3.absorb(data);
}
digest() {
return this.sha3.squeeze();
}
}
export class SHAKE256 {
blockSize = 136;
size;
sha3;
constructor(size) {
this.size = size;
this.sha3 = new SHA3XOF(this.blockSize, this.size);
}
update(data) {
this.sha3.absorb(data);
}
digest() {
return this.sha3.squeeze();
}
}

Xet Storage Details

Size:
973 Bytes
·
Xet hash:
d0e276a587f5b552f8b2f790c240ef372e24cfd67f99ee5d3007d8fc20ce298c

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.