You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SHA3 is becoming more popular and supported by NodeJS, support for it should be added here as well. The popular package "jsSHA" supports this in a relatively easy to wrap way:
classbrowserSHA3_256{
#obj;constructor(hmacKey=undefined){if(hmacKey===undefined){this.#obj=newjssha("SHA3-256","ARRAYBUFFER");}else{if(!(hmacKeyinstanceofUint8Array)){throw(newError('only support Uint8Array for HMAC Key'));}this.#obj=newjssha("SHA3-256","ARRAYBUFFER",{hmacKey: {format: "UINT8ARRAY",value: hmacKey}});}}update(data,options=undefined){if(options!==undefined){throw(newError('options for "update" not supported'));}if(!(datainstanceofArrayBuffer)){data=bufferToArrayBuffer(Buffer.from(data));}this.#obj.update(data);return(this);}digest(encoding=undefined){letretval;switch(encoding){case'hex':
retval=this.#obj.getHash("HEX");break;caseundefined:
retval=Buffer.from(this.#obj.getHash("ARRAYBUFFER"));break;default:
throw(newError(`unsupported encoding "${encoding}"`));}return(retval);}}
The text was updated successfully, but these errors were encountered:
SHA3 is becoming more popular and supported by NodeJS, support for it should be added here as well. The popular package "jsSHA" supports this in a relatively easy to wrap way:
The text was updated successfully, but these errors were encountered: