THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class Argon2Hasher(IHasher): (source)
Constructor: Argon2Hasher(memory, threads, time, executor)
Hash passwords with Argon2id.
Use Argon2id as the framework's default password-hashing algorithm.
Concurrency
A short lock protects parameter snapshots and cache publication. Backend construction and hashing run outside the lock. An operation already using previous parameters can finish after a setter, but cannot restore them in the shared cache.
| Static Method | _validate |
Ensure a cost parameter fits the native algorithm's integer range. |
| Static Method | _validate |
Require enough configured memory for every Argon2 lane. |
| Method | __init__ |
Initialize the driver with its default cost parameters. |
| Method | _backend |
Return the backend class, importing it on first use. |
| Method | _build |
Build a backend instance for the given cost parameters. |
| Method | _check |
Verify a plain text value against an Argon2id hash. |
| Method | _default |
Return the cached backend built from the configured parameters. |
| Method | _identify |
Check whether the hash was produced by the Argon2 family. |
| Method | _make |
Hash a plain text value with Argon2id. |
| Async Method | check |
Verify a plain text value off the event loop. |
| Method | get |
Return the algorithm identifier of this driver. |
| Async Method | make |
Hash a plain text value off the event loop. |
| Method | needs |
Determine whether the hash uses outdated Argon2id parameters. |
| Method | set |
Set the default memory cost used by the driver. |
| Method | set |
Set the default time cost used by the driver. |
| Method | set |
Set the default parallelism used by the driver. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _backend |
Backend implementation used to perform the configured operation. |
| Instance Variable | _backend |
The backend is imported and built on first use to keep the driver constructible even when the dependency is absent. |
| Instance Variable | _executor |
Caller-owned dedicated executor, or the shared bounded hashing pool. |
| Instance Variable | _memory |
Memory cost in kibibytes. |
| Instance Variable | _state |
Lock protecting cost snapshots and backend cache publication. |
| Instance Variable | _threads |
Degree of parallelism. |
| Instance Variable | _time |
Number of iterations. |
Ensure a cost parameter fits the native algorithm's integer range.
| Parameters | |
name:str | Name of the parameter, used in the error message. |
value:int | Value to validate. |
| Returns | |
int | The validated value. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If the value is not a positive integer within the native range. |
Require enough configured memory for every Argon2 lane.
| Parameters | |
memory:int | Validated memory cost in kibibytes. |
threads:int | Validated parallelism. |
| Returns | |
None | No return value. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If fewer than eight kibibytes are available per lane. |
Self, *, memory: int = DEFAULT_MEMORY, threads: int = DEFAULT_THREADS, time: int = DEFAULT_TIME, executor: BoundedExecutor | None = None):
(source)
¶
Initialize the driver with its default cost parameters.
| Parameters | |
memory:int | Memory cost in kibibytes, at least eight per lane and at most 2**32 - 1. |
threads:int | Degree of parallelism from one through 2**24 - 1. |
time:int | Number of iterations from one through 2**32 - 1. |
executor:orionis.support.concurrency.BoundedExecutor | None | Caller-owned dedicated executor, or the shared bounded hashing pool. |
| Returns | |
None | No return value. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If a cost exceeds native bounds or memory is insufficient per lane. |
Return the backend class, importing it on first use.
| Returns | |
typing.Any | Backend class provided by the underlying library. |
| Raises | |
orionis.hashing.exceptions.MissingHashDependencyException | If the backend package is not installed. |
Build a backend instance for the given cost parameters.
| Parameters | |
memory:int | Memory cost in kibibytes. |
threads:int | Degree of parallelism. |
time:int | Number of iterations. |
| Returns | |
typing.Any | Configured backend instance. |
Return the cached backend built from the configured parameters.
| Returns | |
typing.Any | Backend instance reused across calls. |
Self, value: str, *, rounds: int | None = None, memory: int | None = None, threads: int | None = None) -> str:
(source)
¶
Hash a plain text value with Argon2id.
| Parameters | |
value:str | Plain text value to hash. |
rounds:int | None | Per-call time cost override. |
memory:int | None | Per-call memory cost override, in kibibytes. |
threads:int | None | Per-call parallelism override. |
| Returns | |
str | Encoded Argon2id hash. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If an override exceeds native bounds or leaves insufficient memory for the selected parallelism. |
Self, value: str, *, rounds: int | None = None, memory: int | None = None, threads: int | None = None) -> str:
(source)
¶
orionis.hashing.contracts.IHasher.makeHash a plain text value off the event loop.
| Parameters | |
value:str | Plain text value to hash. |
rounds:int | None | Per-call time cost override. |
memory:int | None | Per-call memory cost override, in kibibytes. |
threads:int | None | Per-call parallelism override. |
| Returns | |
str | Encoded Argon2id hash. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If an override exceeds native bounds or leaves insufficient memory for the selected parallelism. |
Set the default memory cost used by the driver.
| Parameters | |
memory:int | New memory cost in kibibytes. |
| Returns | |
typing.Self | The same instance, allowing fluent configuration. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If the value is outside the native memory range or insufficient for the configured parallelism. |
Set the default time cost used by the driver.
| Parameters | |
rounds:int | New number of iterations. |
| Returns | |
typing.Self | The same instance, allowing fluent configuration. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If the value is outside the native time-cost range. |
Set the default parallelism used by the driver.
| Parameters | |
threads:int | New degree of parallelism. |
| Returns | |
typing.Self | The same instance, allowing fluent configuration. |
| Raises | |
orionis.hashing.exceptions.HashConfigurationException | If the value is outside the native parallelism range or requires more memory than configured. |