Generate UUID Module

Hey Fellow Devs,

I have created a simple UUID generator module for one of my projects and have decided to publish it. It’s not a large module, but it can help you generate unique identifiers for basically anything.

You can get it on the Creator Store.

Happy Coding!

8 Likes

Cool module! Good for self-training but uhh…

This exists.

HTTPSerivce:GenerateGUID()
5 Likes

Oh! I didn’t know roblox already has a built in function for that. Thanks for the notice.

2 Likes

Oh, yeah no worries. Still a good module as it was interesting to see your approach! Good job!

module.getUUID = generateUUID

This module is super helpful as HttpService:GenerateGUID() has never fit my needs. So cool and deserves a trophy. Here’s a cookie for being so helpful

Not bad hey, this is kinda better over the default function but if you were to add customization, who knows, I might actually use it! Good job!

There’s no cookie. Here’s one from me :cookie:

Yeah this function is already exists.

also i have made a little module for multiple options that I made for my own use

--!strict
local HttpService: HttpService = game:GetService("HttpService")
return function(wrapInCurlyBraces: boolean?, isSeperatedByHypens: boolean?): string -- 8-4-4-4-12 -> total 36 characters
	return HttpService:GenerateGUID(wrapInCurlyBraces == true):gsub("-", if isSeperatedByHypens then "-" else ""):lower() -- if wrapInCurlyBraces are nil then we are setting default value is false. if is isSeperatedByHypens is false or nil then we are setting "-" else ""
end

New Update

Hey!
I’ve gotten some free time and have decided to update this to allow for a bit more customization. Below are some examples.

includeHyphens: Bool = Wether to include a separator or other hyphens in the UUID

segmentLengths: Table = How many numbers, letters, etc. should be included in each segment - PS: even without a separator this works.

Example for segmentLengths:

module.getUUID({4, 4, 4, 4, 12}, true)

In this case in the first segment, there should be 4 numbers, letters, etc. and in the last 12.

Result:

Bildschirmfoto 2024-05-21 um 17.44.20

You can find the module in the Original Post.

(btw if I have overlooked something e.g. code errors, typos etc. let me know cause its kinda late when im posting this)

Happy Coding! :smile: