Copy the uuid.gd file in your project folder, then start using it.
func _init():
# To generate a new UUID string
print(UUID.v4())
# To generate a new UUID object
var uuid_object = UUID.new()
var uuid_object_2 = UUID.new()
print(uuid_object.as_string())
print(uuid_object.as_dict())
# Get a duplicated object
print(uuid_object.as_array())
# Compare 2 UUID objects
print(uuid_object.is_equal(uuid_object_2))
Changelog for version v4.0.0
2026-01-30 11:52:10
No changelog provided for this version.
Reviews
I can not remember what was its error on Godot 4.7.1. But I pull out BYTE_MASK const, uuidbin func and v4 func from the code, and I make a new file using them, and I made the functions to static, now by using v4 func your code is working awesome and cool for me, thanks.
Better than referencing the uid of Resources when we want to use unique identifiers internally! In my opinion, it needs some rework to use static typing for better performances and maybe using a PackedInt32Array for the main _uuid variable for space efficiency.
Login to write a review.