Crypto UUID v4
by JTE
10
Crypto UUID v4
This addon provides cryptographically secure UUID v4 objects (as references) and String representations in line with official guidelines
Web builds will attempt to use the web browser-provided crypto object if available, and only fall back to weak pseudorandom numbers as a last resort.
Usage
Generating UUIDs:
UUID.new() -> UUID
generates a new randomized UUIDv4 object. (See following sections for usage.)
OR
UUID.v4() -> String
generates a plain UUIDv4 string. (This is astatic
function, you do not need to callnew()
first.)
Comparing UUIDs:
uuid_a.is_equal(uuid_b) -> bool
can compare UUID objects, a UUID object against a UUID string, or a UUID object against a PoolByteArray containing 16 bytes.str(uuid_a) == str(uuid_b)
can compare any two UUID string representations or objects
Other functionality:
str(uuid)
returns the formattedString
representation of a UUID object, in the same standard format asUUID.v4()
would generate.UUID.new(from: String) -> UUID
returns a UUID object from a valid UUID String representation (eg. if serialized)UUID.new(from: PoolByteArray) -> UUID
returns a UUID object from a PoolByteArray containing 16 bytesUUID.v4bin() -> PoolByteArray
generates an array containing 16 bytesUUID.format(data: PoolByteArray) -> String
generates a UUID string from aPoolByteArray
containing 16 bytes (no validation checks)
Download
Version1.0.1
Download Now
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author