Skip to content

RedGPU API v4.4.0-Alpha


RedGPU API / RedGPU / Util / uuidToUint

Function: uuidToUint() ​

uuidToUint(uuid): number

Defined in: src/utils/uuid/uuidToUint.ts:18

Converts a UUID string to a 32-bit unsigned integer by parsing its first 8 characters (hyphens removed) as hexadecimal.

Example ​

typescript
const uintId = RedGPU.Util.uuidToUint('123e4567-e89b-12d3-a456-426614174000');

Parameters ​

ParameterTypeDescription
uuidstringUUID string to convert

Returns ​

number

Converted uint32 value (0 ~ 4294967295)