Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Zozi96/hash-forge/llms.txt

Use this file to discover all available pages before exploring further.

AlgorithmType is a Literal type alias that enumerates every algorithm identifier accepted by Hash Forge’s public API. Wherever an algorithm name is expected — HashManager.from_algorithms, HashManager.quick_hash, PasswordHashPolicy fields, HashManagerBuilder.with_algorithm, and more — the parameter is typed as AlgorithmType. This gives you IDE autocompletion for all valid values and lets static type checkers (mypy, pyright, Pylance) catch misspellings or unsupported algorithm names at analysis time rather than at runtime.
from hash_forge import AlgorithmType

Full Definition

from typing import Literal

AlgorithmType = Literal[
    "pbkdf2_sha256",
    "pbkdf2_sha1",
    "bcrypt",
    "bcrypt_sha256",
    "argon2",
    "scrypt",
    "blake2",
    "blake2b",
    "blake3",
    "whirlpool",
    "ripemd160",
    "RIPEMD-160",
    "sha3_256",
    "sha3_512",
]

Algorithm Reference

IdentifierCategoryNotes
"pbkdf2_sha256"passwordNIST-recommended KDF; FIPS-compatible.
"pbkdf2_sha1"legacyOlder PBKDF2 variant; verify-only in most policies.
"bcrypt"passwordClassic bcrypt; wide ecosystem support.
"bcrypt_sha256"passwordbcrypt pre-hashed with SHA-256; handles long passwords.
"argon2"passwordArgon2id; winner of Password Hashing Competition. Recommended default.
"scrypt"passwordMemory-hard KDF; good alternative to Argon2.
"blake2"digestFast cryptographic hash; not a password KDF.
"blake2b"digestAlias for "blake2" — see note below.
"blake3"digestNext-generation fast hash; not a password KDF.
"whirlpool"deprecatedLegacy Miyaguchi–Preneel hash; avoid for new hashes.
"ripemd160"legacy160-bit hash; legacy verify only.
"RIPEMD-160"legacyAlias for "ripemd160" — see note below.
"sha3_256"digestSHA-3 (Keccak) at 256 bits; not a password KDF.
"sha3_512"digestSHA-3 (Keccak) at 512 bits; not a password KDF.

Aliases

Two identifiers are aliases for canonical algorithm names. Hash Forge resolves them transparently in inspect, classify_algorithm, and canonical_algorithm:
  • "blake2b" is an alias for "blake2". Both are accepted anywhere AlgorithmType is expected and produce identical hashers.
  • "RIPEMD-160" is an alias for "ripemd160". The uppercase form mirrors the algorithm’s official name and is accepted for compatibility.
from hash_forge import canonical_algorithm

canonical_algorithm("blake2b")    # "blake2"
canonical_algorithm("RIPEMD-160") # "ripemd160"
Prefer the canonical forms ("blake2", "ripemd160") in new code to avoid confusion. The aliases are kept for compatibility with existing hash strings and third-party tooling.

Usage Example

Annotate any function that accepts an algorithm name with AlgorithmType to get full static analysis coverage:
from hash_forge import HashManager, AlgorithmType

def create_manager(algorithm: AlgorithmType) -> HashManager:
    return HashManager.from_algorithms(algorithm)

# mypy / pyright will accept this:
manager = create_manager("argon2")

# mypy / pyright will flag this as a type error:
manager = create_manager("md5")  # error: Argument 1 ... Literal['md5'] is not assignable
Use AlgorithmType in configuration objects or dependency-injection containers:
from hash_forge import HashManager, AlgorithmType

class AppConfig:
    primary_algorithm: AlgorithmType = "argon2"
    fallback_algorithms: tuple[AlgorithmType, ...] = ("pbkdf2_sha256", "bcrypt")

def build_manager(cfg: AppConfig) -> HashManager:
    return HashManager.from_algorithms(cfg.primary_algorithm, *cfg.fallback_algorithms)

py.typed Marker

Hash Forge ships a py.typed marker file, which signals to PEP 561–aware type checkers that the package provides inline type information. This means mypy, pyright, and Pylance will pick up AlgorithmType and all other type annotations from Hash Forge automatically — no stub packages or extra configuration required.
# Verify the marker is present in your environment
python -c "import importlib.resources as r; print(list(r.files('hash_forge').iterdir()))"
If you use pyright with strict mode ("typeCheckingMode": "strict" in pyrightconfig.json), annotating all algorithm parameters as AlgorithmType gives you exhaustiveness checking — the type checker will warn you if a new algorithm is added to AlgorithmType that your match/if chains do not handle.

Build docs developers (and LLMs) love