
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@accumulators/hashers
Advanced tools
@accmulators/hashers
library implements the following hashing algorithms:
import { KeccakHasher } from "@accmulators/hashers";
const hasher = new KeccakHasher();
const hash = hasher.hash([`0x1234`, `0x5678`]);
console.log(hash);
Every hasher supports the following functions:
constructor(options: HasherOptions)
- creates a new hasher instanceImporant: Don't use constructor for PoseidonHasher
, use async create()
function instead.
HasherOptions
has the following interface:
interface HasherOptions {
blockSizeBits: number;
shouldPad?: boolean;
}
blockSizeBits
(default is 256)shouldPad
(defaults is false
) - if true
every outputted hash will have the same length and zeros will be padded at the beginning of the stringhashSingle(data: string)
Hashes a single string. Returns a hexadecimal number as a string (for example 0x1234567890abcdef
).
hash(data: string[])
Hashes array of string and returns a hexadecimal number as a string.
4.2.3 (2023-10-06)
Note: Version bump only for package accumulators
FAQs
A TypeScript implementation of multiple hashing functions
We found that @accumulators/hashers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.