Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
improved algorithm detection
Browse files Browse the repository at this point in the history
  • Loading branch information
UmamiAppearance committed Sep 14, 2022
1 parent 7ab6f83 commit d9b7757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BrowserSHAObj {

const algorithms = this.constructor.algorithmsAvailable();

this.#bits = String(algorithm).match(/[0-9]+/)[0]|0;
this.#bits = [].concat(String(algorithm).match(/[0-9]+/)).at(0)|0;
this.blockSize = this.#bits > 256 ? 128 : 64;
this.#algorithm = `SHA-${this.#bits}`;

Expand Down

0 comments on commit d9b7757

Please sign in to comment.