ruid v0.1.0 Ruid

Generate a 64-bit UUID having the format: <<_::8(type), _::48(ts), _::8(unused)>>. By including the creation time in the id, there’s no need for a created_at column in the DB table.

Link to this section Summary

Functions

Convert hex string to 64-bit id

Generate a 64-bit id. Type code is a 1-byte integer common to a resource type. E.g 10 for users, 20 for roles etc

Convert 64-bit to hex string

Link to this section Functions

Link to this function from_string(id_str)
from_string(binary) :: integer

Convert hex string to 64-bit id.

Link to this function generate(resource_code)
generate(integer) :: integer

Generate a 64-bit id. Type code is a 1-byte integer common to a resource type. E.g 10 for users, 20 for roles etc

Link to this function to_string(id)
to_string(integer) :: binary

Convert 64-bit to hex string.