Algorithms
provide.foundation.crypto.algorithms
¶
TODO: Add module docstring.
Classes¶
Functions¶
get_digest_size
¶
Get the digest size in bytes for an algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
str
|
Hash algorithm name |
required |
Returns:
| Type | Description |
|---|---|
int
|
Digest size in bytes |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If algorithm is not supported |
Source code in provide/foundation/crypto/algorithms.py
get_hasher
¶
Get a hash object for the specified algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
str
|
Hash algorithm name |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Hash object from hashlib |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If algorithm is not supported |
Source code in provide/foundation/crypto/algorithms.py
is_secure_algorithm
¶
validate_algorithm
¶
Validate that a hash algorithm is supported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
algorithm
|
str
|
Hash algorithm name |
required |
Raises:
| Type | Description |
|---|---|
ValidationError
|
If algorithm is not supported |