All Projects → mmacedoeu → rulid.rs

mmacedoeu / rulid.rs

Licence: MIT license
Rust Universally Unique Lexicographically Sortable Identifier

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rulid.rs

python-ulid
ULID implementation for Python
Stars: ✭ 177 (+342.5%)
Mutual labels:  uuid, ulid
ulid-creator
A Java library for generating Universally Unique Lexicographically Sortable Identifiers (ULID)
Stars: ✭ 38 (-5%)
Mutual labels:  uuid, ulid
go-ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Go - Please use https://github.com/oklog/ulid
Stars: ✭ 31 (-22.5%)
Mutual labels:  uuid, ulid
Javascript
Universally Unique Lexicographically Sortable Identifier
Stars: ✭ 1,781 (+4352.5%)
Mutual labels:  uuid, ulid
ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Crystal
Stars: ✭ 28 (-30%)
Mutual labels:  uuid, ulid
ulid
Haskell implementation of ULIDs (Unique Lexicographically Sortable Identifiers)
Stars: ✭ 22 (-45%)
Mutual labels:  uuid, ulid
uuid-generator-plugin
An IntelliJ Idea plugin to generate UUID (Universally Unique Identifier), ULID (Universally Unique Lexicographically Sortable Identifier) and CUID (Collision Resistant Unique Identifier)
Stars: ✭ 30 (-25%)
Mutual labels:  uuid, ulid
Cinelights
Example project using Lighting tools package and Cine lights package for Unity.
Stars: ✭ 23 (-42.5%)
Mutual labels:  character
ruuid
A fast uuid generator in Python using Rust
Stars: ✭ 19 (-52.5%)
Mutual labels:  uuid
sqlike
Golang Sequel ORM that supports Enum, JSON, Spatial, and many more
Stars: ✭ 18 (-55%)
Mutual labels:  uuid
animec
A module to get data about anime characters, news, info, lyrics and more.
Stars: ✭ 31 (-22.5%)
Mutual labels:  character
SimpleReminder
Efficient creation of simple reminders on Android.
Stars: ✭ 28 (-30%)
Mutual labels:  efficiency
ruby-ulid
generator, parser, optional monotonicity and manipulations for ULID
Stars: ✭ 19 (-52.5%)
Mutual labels:  ulid
ProjectKaya
Project Kaya for mobile game platform
Stars: ✭ 324 (+710%)
Mutual labels:  character
php-search-all-database
With this code, you can search all database with narrowing down the Tables & Column to search in, Resulting in low traversing & high performance
Stars: ✭ 21 (-47.5%)
Mutual labels:  efficiency
uuids
UUID library for Nim
Stars: ✭ 28 (-30%)
Mutual labels:  uuid
ThirdPersonController
Simple 3rd person controller demonstrating camera-relative movement and the new Cinemachine 3rd Person Follow / Aim system
Stars: ✭ 15 (-62.5%)
Mutual labels:  character
id-mask
IDMask is a Java library for masking internal ids (e.g. from your DB) when they need to be published to hide their actual value and to prevent forging. It has support optional randomisation has a wide support for various Java types including long, UUID and BigInteger. This library bases its security on strong cryptographic primitives.
Stars: ✭ 39 (-2.5%)
Mutual labels:  uuid
CNeptune
CNeptune improve productivity & efficiency by urbanize .net module with meta-code to lay foundation for frameworks
Stars: ✭ 30 (-25%)
Mutual labels:  efficiency
JPQ
CIKM'21: JPQ substantially improves the efficiency of Dense Retrieval with 30x compression ratio, 10x CPU speedup and 2x GPU speedup.
Stars: ✭ 39 (-2.5%)
Mutual labels:  efficiency

Universally Unique Lexicographically Sortable Identifier

Build Status Language (Rust)

UUID can be suboptimal for many uses-cases because:

  • It isn't the most character efficient way of encoding 128 bits of randomness
  • The string format itself is apparently based on the original MAC & time version (UUIDv1 from Wikipedia)
  • It provides no other information than randomness

Instead, herein is proposed ULID:

  • 128-bit compatibility with UUID
  • 1.21e+24 unique ULIDs per millisecond
  • Lexicographically sortable!
  • Canonically encoded as a 26 character string, as opposed to the 36 character UUID
  • Uses Crockford's base32 for better efficiency and readability (5 bits per character)
  • Case insensitive
  • No special characters (URL safe)

Implementations in other languages

From the community!

Language Author
Javascript alizain
Erlang savonarola
Elixir merongivian
Go imdario
Java Lewiscowles1986
Julia ararslan
.NET RobThree
.NET fvilers
PHP Lewiscowles1986
Python mdipierro
Ruby rafaelsales

Specification

Below is the current specification of ULID as implemented in this repository.

 01AN4Z07BY      79KA1307SR9X4MV3

|----------|    |----------------|
 Timestamp          Randomness
  10 chars           16 chars
   50bits             80bits
   base32             base32

Components

Timestamp

  • 48 bit integer
  • UNIX-time in milliseconds
  • Won't run out of space till the year 10895 AD.

Randomness

  • 80 bits
  • Cryptographically secure source of randomness, if possible

Sorting

The left-most character must be sorted first, and the right-most character sorted last (lexical order). The default ASCII character set must be used. Within the same millisecond, sort order is not guaranteed

Encoding

Crockford's Base32 is used as shown. This alphabet excludes the letters I, L, O, and U to avoid confusion and abuse.

0123456789ABCDEFGHJKMNPQRSTVWXYZ

Binary Layout and Byte Order

The components are encoded as 16 octets. Each component is encoded with the Most Significant Byte first (network byte order).

0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      32_bit_uint_time_low                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     16_bit_uint_time_high     |       16_bit_uint_random      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       32_bit_uint_random                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       32_bit_uint_random                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

String Representation

ttttttttttrrrrrrrrrrrrrrrr

where
t is Timestamp
r is Randomness

Prior Art

Partly inspired by:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].