gxid
Types
Values
pub fn compare(a: XID, b: XID) -> order.Order
Orders two XIDs by creation time, then machine, process and counter
pub fn from_bit_array(bit_xid: BitArray) -> Result(XID, Nil)
Builds an XID from its 12-byte binary representation
pub fn generate(channel: process.Subject(Message)) -> XID
Deprecated: Use gxid.new, which needs no process
Generates an XID through a process started with start
pub fn new() -> XID
Generates a new XID
Safe to call from any number of processes at once: no process needs to be started first.
Usage
import gxid.{type XID}
let xid: XID = gxid.new()
pub fn parse(str_xid: String) -> Result(XID, Nil)
Parses an XID from its 20-character string representation
Usage
import gxid
let assert Ok(xid) = gxid.parse("9m4e2mr0ui3e8a215n4g")
pub fn random_number(xid: XID) -> Int
Deprecated: Use gxid.counter
Returns the counter from XID type
pub fn start() -> Result(
process.Subject(Message),
actor.StartError,
)
Deprecated: Use gxid.new, which needs no process
Starts a process generating XIDs
pub fn to_bit_array(xid: XID) -> BitArray
Returns the 12-byte binary representation of an XID