Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

HASH_PACKAGE

const HASH_PACKAGE: IEnginePackage;

Defined in: packages/engine/src/packages/hash/HashPackage.ts:20

Cryptographic and checksum digests (issue #240): sha256, sha1, sha512, md5 and crc32, each turning a piece of text into its short fixed-length fingerprint, written as lower-case hex.

A neighbour of the text-encoding package, and like it on by default and removable. The implementations are pure and synchronous (no Node crypto, no async Web Crypto), so a digest is an ordinary value produced on the spot and works unchanged in the browser worker.

The output is hex, the universal default that sha256sum and its kin produce. md5 and sha1 are offered for compatibility with existing systems; both are long broken for collision resistance and should not be used where that matters. A non-text input is answered with a structured Error.