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.

Argon2id won the Password Hashing Competition and is the recommended default driver of the framework.

Concurrency

No locks are used. The backend class and the backend instance are cached on first use: a concurrent first use from several threads may build them twice, and the last write wins. Hashing operations only read that cache, and the fluent setters drop it so later calls rebuild the backend with the new cost parameters.

Static Method _validate Ensure a cost parameter is a strictly positive integer.
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__ Undocumented
Instance Variable _backend Undocumented
Instance Variable _backend_class Undocumented
Instance Variable _memory Undocumented
Instance Variable _threads Undocumented
Instance Variable _time Undocumented
def _validate(name: str, value: int) -> int: (source)

Ensure a cost parameter is a strictly positive integer.

Parameters
name:strName of the parameter, used in the error message.
value:intValue to validate.
Returns
intThe validated value.
Raises
HashConfigurationExceptionIf the value is not an integer greater than zero.
def __init__(self, *, memory: int = DEFAULT_MEMORY, threads: int = DEFAULT_THREADS, time: int = DEFAULT_TIME): (source)

Initialize the driver with its default cost parameters.

Parameters
memory:intMemory cost in kibibytes.
threads:intDegree of parallelism.
time:intNumber of iterations.
Returns
NoneThis method initializes the instance and returns None.
Raises
HashConfigurationExceptionIf any cost parameter is not a positive integer.
def _backendClass(self) -> Any: (source)

Return the backend class, importing it on first use.

Returns
AnyBackend class provided by the underlying library.
Raises
MissingHashDependencyExceptionIf the backend package is not installed.
def _build(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
AnyConfigured backend instance.
def _check(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) -> Any: (source)

Return the cached backend built from the configured parameters.

Returns
AnyBackend instance reused across calls.
def _identify(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, 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
HashConfigurationExceptionIf any override is not a positive integer.
async def check(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) -> str: (source)

Return the algorithm identifier of this driver.

Returns
strAlways 'argon2id'.
async def make(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
HashConfigurationExceptionIf any override is not a positive integer.
def needsRehash(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, memory: int) -> Self: (source)

Set the default memory cost used by the driver.

Parameters
memory:intNew memory cost in kibibytes.
Returns
SelfThe same instance, allowing fluent configuration.
Raises
HashConfigurationExceptionIf the value is not a positive integer.
def setRounds(self, rounds: int) -> Self: (source)

Set the default time cost used by the driver.

Parameters
rounds:intNew number of iterations.
Returns
SelfThe same instance, allowing fluent configuration.
Raises
HashConfigurationExceptionIf the value is not a positive integer.
def setThreads(self, threads: int) -> Self: (source)

Set the default parallelism used by the driver.

Parameters
threads:intNew degree of parallelism.
Returns
SelfThe same instance, allowing fluent configuration.
Raises
HashConfigurationExceptionIf the value is not a positive integer.
_backend: Any = (source)

Undocumented

_backend_class: Any = (source)

Undocumented

Undocumented

_threads = (source)

Undocumented

Undocumented