Module util
Generic utility functions.
Functions
objectuuids.util.patch_entity_def (def, patches) | Applies a patch to an entity definition. |
objectuuids.util.canonicalise_uuid (uuid) | Canonicalises and validates a UUID. |
objectuuids.util.generate_uuid4 (random) | Generates a version 4 (random) UUID. |
objectuuids.util.generate_uuid5 (namespace, name) | Generates a version 5 (SHA-1) UUID. |
objectuuids.util.uuid_to_bytes (uuid) | Converts a UUID to a packed binary representation. |
Functions
- objectuuids.util.patch_entity_def (def, patches)
-
Applies a patch to an entity definition.
Parameters:
- def [table] The entity definition table. Modified in-place.
- patches [table] A table of functions. Each function receives the original function as its first argument.
- objectuuids.util.canonicalise_uuid (uuid)
-
Canonicalises and validates a UUID.
Parameters:
- uuid [string] A UUID, in lenient form.
Returns:
-
[string] The same UUID, in strict form.
- objectuuids.util.generate_uuid4 (random)
-
Generates a version 4 (random) UUID.
Parameters:
- random [function|nil] Overrides the random number generator.
Returns:
-
[string] A UUID.
- objectuuids.util.generate_uuid5 (namespace, name)
-
Generates a version 5 (SHA-1) UUID.
Parameters:
- namespace [string] The namespace UUID.
- name [string] The string to hash.
Returns:
-
[string] A UUID.
- objectuuids.util.uuid_to_bytes (uuid)
-
Converts a UUID to a packed binary representation.
Parameters:
- uuid [string] A UUID.
Returns:
-
[string] The same UUID in binary form.