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.
Hash passwords with bcrypt.
Kept for interoperability with existing applications that already store bcrypt hashes.
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 setter drops it so later calls rebuild the backend with the new cost factor.
| Static Method | _validate |
Ensure the cost factor is supported by bcrypt. |
| Method | __init__ |
Initialize the driver with its default cost factor. |
| Method | _backend |
Return the backend class, importing it on first use. |
| Method | _build |
Build a backend instance for the given cost factor. |
| Method | _check |
Verify a plain text value against a bcrypt hash. |
| Method | _default |
Return the cached backend built from the configured cost factor. |
| Method | _identify |
Check whether the hash was produced by bcrypt. |
| Method | _make |
Hash a plain text value with bcrypt. |
| 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 an outdated cost factor. |
| Method | set |
Set the default cost factor used by the driver. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _backend |
Undocumented |
| Instance Variable | _backend |
Undocumented |
| Instance Variable | _rounds |
Undocumented |
Return the backend class, importing it on first use.
| Returns | |
Any | Backend class provided by the underlying library. |
| Raises | |
MissingHashDependencyException | If the backend package is not installed. |
Build a backend instance for the given cost factor.
| Parameters | |
rounds:int | Cost factor applied by the backend. |
| Returns | |
Any | Configured backend instance. |
Return the cached backend built from the configured cost factor.
| Returns | |
Any | Backend instance reused across calls. |
str, *, rounds: int | None = None, memory: int | None = None, threads: int | None = None) -> str:
(source)
¶
Hash a plain text value with bcrypt.
| Parameters | |
value:str | Plain text value to hash. |
rounds:int | None | Per-call cost factor override. |
memory:int | None | Ignored, bcrypt has no memory cost parameter. |
threads:int | None | Ignored, bcrypt has no parallelism parameter. |
| Returns | |
str | Encoded bcrypt hash. |
| Raises | |
HashConfigurationException | If rounds falls outside the range supported by bcrypt. |
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 cost factor override. |
memory:int | None | Ignored, bcrypt has no memory cost parameter. |
threads:int | None | Ignored, bcrypt has no parallelism parameter. |
| Returns | |
str | Encoded bcrypt hash. |
| Raises | |
HashConfigurationException | If rounds falls outside the range supported by bcrypt. |
Set the default cost factor used by the driver.
| Parameters | |
rounds:int | New cost factor. |
| Returns | |
Self | The same instance, allowing fluent configuration. |
| Raises | |
HashConfigurationException | If the value falls outside the range supported by bcrypt. |