GUID

The FireflyAIO Lua API includes a GUID function that generates a random globally unique identifier (GUID). A GUID is a 128-bit number used to uniquely identify information in computer systems. The GUID function is useful for generating unique identifiers for various purposes, such as session IDs, transaction IDs, or any scenario requiring a unique value.

Using the GUID Function

The GUID function does not require any arguments and returns a random GUID each time it is called.

Here is an example of how to use the GUID function:

-- Generate a random GUID
local uniqueIdentifier = GUID()

-- Print the generated GUID
print(uniqueIdentifier)

Example Output

The output of the GUID function is a string formatted as a GUID, for example:

3f1e2b4a-9c1d-41c6-90d5-72e9ef1b6a2f

Usage Scenarios

  • Session Management: Create unique session IDs for user sessions.

  • Transaction Tracking: Generate unique transaction IDs for logging and tracking.

  • Resource Identifiers: Assign unique identifiers to resources in a system.

  • Testing and Development: Generate unique values for testing purposes.

By using the GUID function, you can easily generate unique identifiers within your custom checkers in FireflyAIO, ensuring that your application can reliably distinguish between different entities and events.

Last updated