Module id to hex?

I want to achieve a script where it loads a module, say for example: 12345678 turns into 0x1A8F0L, pretty sure Hex (idk what this is, just an example)

I cannot find a number to hex, only decimal to hexadecimal.
I’ve tried using the decimal to hexadecimal converter, it did not work.

2 Likes

A decimal is a number


I have one question, why are you doing this?

2 Likes

to load a module

when using the decimal to hexadecimal converter, it didn’t come up with a 0x number

1 Like

Correct me if I am wrong but don’t you load a module by id with by doing

require(12345678) -- asset id
1 Like

yes, but i dont want my (future) devs to find the modules

1 Like

Ok, I’m not really sure what that means. You are able to make modules closed source by uploading them to your account, naming them MainModule, and using require by id. (only works on the server)

No matter what you have to put the asset id of the module in require(), if you put 0x2134836 you’ll get an error, besides anyone can easily convert hex back to decimal.

2 Likes

Odd thing to do, but I just think it’s worth saying that anyone can decode the hex within seconds to find the module. Doesn’t matter what you do, if someone absolutely wanted to, they’ll always be able to decode the script to find the module (assuming they don’t check your inventory or creations)

it’s just an extra security measure

Try asciitohex.com. Type your number into the decimal field and click convert, you should get the hex code in the hex field.

For example, 12345678 would convert to bc614e, so to use this in lua it’d be 0xBC614E

Nothing is stopping other people from printing the number, which will be printed normally (base 10).

print(0xFF) --> 255

Overall, I wouldn’t recommend this. It’s not easy protecting the source code of your modules, especially after the removal of private modules.

Idk man this kinda sounds sus…

But you wouldn’t really be able to hide much, as it would easily be decoded