A module for Garry's Mod that allows the generation of version 4 UUID strings using the Boost library.
I only release prebuilt binaries for x64 on Linux & Windows. However, feel free to modify and build the code if you need x86 or macOS support. I don't offer support for these myself because x86 is old and I can't afford to test my code on macOS.
After downloading the binary of your choice, rename the gm_
prefix appropriately depending on which realm you'll be using it in. For more information, check this wiki article.
Downloads for the latest binaries:
Here's a simple example of how you would use this:
require( "uuid" )
-- The only argument is a boolean for including the dashes, it defaults to true.
print( GenerateUUID() ) -- 123e4567-e89b-12d3-a456-426655440000
print( GenerateUUID( true ) ) -- 123e4567-e89b-12d3-a456-426655440000
print( GenerateUUID( false ) ) -- 123e4567e89b12d3a456426655440000
- Download a copy of the repository and extract it into a folder.
- Download and extract Premake 5 (for Windows) into the repository folder (or add it to your environment path, if you're going to use it again later).
- Open Command Prompt in the repository folder (
cd
into the folder). - Run
premake5 --file=scripts/premake5.lua vs2019
to generate a Visual Studio 2019 project. - Open the Visual Studio 2019 solution file created at
projects/windows/uuid.sln
. - Press
Build
>Build Solution
to build the project (the module will be placed indeploy/gm_uuid_win64.dll
).
- Download a copy of the repository and extract it into a folder.
- Download and extract Premake 5 (for Linux) into the repository folder (or add it to your environment path, if you're going to use it again later).
- Open your favourite terminal in the repository folder (
cd
into the folder). - Make the extracted
premake5
file executable (chmod +x premake5
). - Run
premake5 --file=scripts/premake5.lua gmake
to generate a Make project. - Navigate to
project/linux/
(cd /project/linux
). - Run
make
to build the project (the module will be placed indeploy/gm_uuid_linux64.dll
).
Copyright (C) 2020 - 2022 viral32111. Licenced under GNU AGPLv3.