Skip to content

plainenglishh/ulid.luau

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ulid.luau

A Universally Unique Lexicographically Sortable Identifier generator for Luau.

Installation

Simply copy and paste the contents of lib/init.luau into your project.

This project should work in the following runtimes:-

Runtime Supported Has detectable CSPRNG Has detectable ms-precise time function
Roblox
Lune
Zune
Pure Luau

Usage

local ulid = require("./ulid").generator();

print(ulid()); --> 01BX5ZZKBKACTAV9WEVGEMMVS0

A list of generator options is as follows:-

Option Type Default Description
monotonic boolean false Whether to use a monotonic generator
dependencies { prng: (min: number, max: number) -> number, time: () -> number } Runtime Dependent Dictionary of functions to provide dependent functions
allow_insecure boolean false Whether to suppress insecure errors
allow_imprecise boolean false Whether to suppress imprecise errors

Attributions

Partially based on the ULID reference implementation.

Contributing

Please feel free to submit pull requests, preferably stick to the same code style.

About

A ULID generator implemented in pure luau.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages