UUID¶
The rite.crypto.uuid submodule contains helpers for generating, transforming, and validating UUID values.
Identity Module¶
This module provides unique identifier generation similar to Python's uuid module.
Functions will include: - UUID generation and utilities
Example
from rite.identity import generate_uuid generate_uuid() 'a1b2c3d4-e5f6-...'
Functions¶
is_valid_uuid(uuid_to_test: str, version: int = 4) -> bool
¶
Check if uuid_to_test is a valid UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uuid_to_test
|
str
|
String to validate as UUID |
required |
version
|
int
|
UUID version to check (1, 2, 3, or 4) |
4
|
Returns:
| Type | Description |
|---|---|
bool
|
True if valid UUID, False otherwise |
Example
is_valid_uuid('550e8400-e29b-41d4-a716-446655440000') True is_valid_uuid('invalid') False
Modules¶
uuid_get_version
¶
uuid_hex
¶
uuid_is_random
¶
uuid_is_valid
¶
UUID Validation¶
Validate UUID strings.
Functions¶
is_valid_uuid(uuid_to_test: str, version: int = 4) -> bool
¶
Check if uuid_to_test is a valid UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uuid_to_test
|
str
|
String to validate as UUID |
required |
version
|
int
|
UUID version to check (1, 2, 3, or 4) |
4
|
Returns:
| Type | Description |
|---|---|
bool
|
True if valid UUID, False otherwise |
Example
is_valid_uuid('550e8400-e29b-41d4-a716-446655440000') True is_valid_uuid('invalid') False
uuid_random
¶
options: show_root_heading: true show_source: false heading_level: 2