Functions
hash_str
3
str
▼
Hash string content using specified algorithm.
hash_str
3
str
▼
def hash_str(content: str, truncate: int | None = None, algorithm: str = 'sha256') -> str
Parameters
| Name | Type | Description |
|---|---|---|
content |
str |
String content to hash |
truncate |
int | None |
Truncate result to N characters (None = full hash) Default:None
|
algorithm |
str |
Hash algorithm ('sha256', 'md5') Default:'sha256'
|
Returns
str
hash_bytes
3
str
▼
Hash bytes content using specified algorithm.
hash_bytes
3
str
▼
def hash_bytes(content: bytes, truncate: int | None = None, algorithm: str = 'sha256') -> str
Parameters
| Name | Type | Description |
|---|---|---|
content |
bytes |
Bytes content to hash |
truncate |
int | None |
Truncate result to N characters (None = full hash) Default:None
|
algorithm |
str |
Hash algorithm ('sha256', 'md5') Default:'sha256'
|
Returns
str