ORIONIS API REFERENCE

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 documentation

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 _validateMemory Require enough configured memory for every Argon2 lane.
Method __init__ Initialize the driver with its default cost parameters.
Method _backendClass 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 getAlgorithm Return the algorithm identifier of this driver.
Async Method make Hash a plain text value off the event loop.
Method needsRehash Determine whether the hash uses outdated Argon2id parameters.
Method setMemory Set the default memory cost used by the driver.
Method setRounds Set the default time cost used by the driver.
Method setThreads 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_class 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 Lock protecting cost snapshots and backend cache publication.
Instance Variable _threads Degree of parallelism.
Instance Variable _time Number of iterations.
def _validate(name: str, value: int) -> int: (source)

Ensure a cost parameter fits the native algorithm's integer range.

Parameters
name:strName of the parameter, used in the error message.
value:intValue to validate.
Returns
intThe validated value.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf the value is not a positive integer within the native range.
def _validateMemory(memory: int, threads: int): (source)

Require enough configured memory for every Argon2 lane.

Parameters
memory:intValidated memory cost in kibibytes.
threads:intValidated parallelism.
Returns
NoneNo return value.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf fewer than eight kibibytes are available per lane.
def __init__(self: 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:intMemory cost in kibibytes, at least eight per lane and at most 2**32 - 1.
threads:intDegree of parallelism from one through 2**24 - 1.
time:intNumber of iterations from one through 2**32 - 1.
executor:orionis.support.concurrency.BoundedExecutor | NoneCaller-owned dedicated executor, or the shared bounded hashing pool.
Returns
NoneNo return value.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf a cost exceeds native bounds or memory is insufficient per lane.
def _backendClass(self: Self) -> Any: (source)

Return the backend class, importing it on first use.

Returns
typing.AnyBackend class provided by the underlying library.
Raises
orionis.hashing.exceptions.MissingHashDependencyExceptionIf the backend package is not installed.
def _build(self: Self, memory: int, threads: int, time: int) -> Any: (source)

Build a backend instance for the given cost parameters.

Parameters
memory:intMemory cost in kibibytes.
threads:intDegree of parallelism.
time:intNumber of iterations.
Returns
typing.AnyConfigured backend instance.
def _check(self: Self, value: str, hashed: str) -> bool: (source)

Verify a plain text value against an Argon2id hash.

Parameters
value:strPlain text value to verify.
hashed:strPreviously generated hash.
Returns
boolTrue when the value matches the hash, False otherwise.
def _default(self: Self) -> Any: (source)

Return the cached backend built from the configured parameters.

Returns
typing.AnyBackend instance reused across calls.
def _identify(self: Self, hashed: str) -> bool: (source)

Check whether the hash was produced by the Argon2 family.

Parameters
hashed:strHash to inspect.
Returns
boolTrue when the hash belongs to this driver.
def _make(self: 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:strPlain text value to hash.
rounds:int | NonePer-call time cost override.
memory:int | NonePer-call memory cost override, in kibibytes.
threads:int | NonePer-call parallelism override.
Returns
strEncoded Argon2id hash.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf an override exceeds native bounds or leaves insufficient memory for the selected parallelism.
async def check(self: Self, value: str, hashed: str) -> bool: (source)

Verify a plain text value off the event loop.

Parameters
value:strPlain text value to verify.
hashed:strPreviously generated hash.
Returns
boolTrue when the value matches the hash, False otherwise.
def getAlgorithm(self: Self) -> str: (source)

Return the algorithm identifier of this driver.

Returns
strAlways 'argon2id'.
async def make(self: Self, value: str, *, rounds: int | None = None, memory: int | None = None, threads: int | None = None) -> str: (source)

Hash a plain text value off the event loop.

Parameters
value:strPlain text value to hash.
rounds:int | NonePer-call time cost override.
memory:int | NonePer-call memory cost override, in kibibytes.
threads:int | NonePer-call parallelism override.
Returns
strEncoded Argon2id hash.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf an override exceeds native bounds or leaves insufficient memory for the selected parallelism.
def needsRehash(self: Self, hashed: str) -> bool: (source)

Determine whether the hash uses outdated Argon2id parameters.

Parameters
hashed:strPreviously generated hash.
Returns
boolTrue when the hash should be regenerated.
def setMemory(self: Self, memory: int) -> Self: (source)

Set the default memory cost used by the driver.

Parameters
memory:intNew memory cost in kibibytes.
Returns
typing.SelfThe same instance, allowing fluent configuration.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf the value is outside the native memory range or insufficient for the configured parallelism.
def setRounds(self: Self, rounds: int) -> Self: (source)

Set the default time cost used by the driver.

Parameters
rounds:intNew number of iterations.
Returns
typing.SelfThe same instance, allowing fluent configuration.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf the value is outside the native time-cost range.
def setThreads(self: Self, threads: int) -> Self: (source)

Set the default parallelism used by the driver.

Parameters
threads:intNew degree of parallelism.
Returns
typing.SelfThe same instance, allowing fluent configuration.
Raises
orionis.hashing.exceptions.HashConfigurationExceptionIf the value is outside the native parallelism range or requires more memory than configured.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

_backend: Any = (source)

Backend implementation used to perform the configured operation.

_backend_class: Any = (source)

The backend is imported and built on first use to keep the driver constructible even when the dependency is absent.

_executor = (source)

Caller-owned dedicated executor, or the shared bounded hashing pool.

Memory cost in kibibytes.

_state_lock = (source)

Lock protecting cost snapshots and backend cache publication.

_threads = (source)

Degree of parallelism.

Number of iterations.