Liking cljdoc? Tell your friends :D

com.vadelabs.uid.flake.core

Core implementation for high-performance unique identifiers.

Provides functions for generating and manipulating Flakes - 192-bit identifiers that combine nanosecond timestamps with high-entropy random data to ensure both uniqueness and monotonic ordering properties.

Core implementation for high-performance unique identifiers.

Provides functions for generating and manipulating Flakes - 192-bit identifiers
that combine nanosecond timestamps with high-entropy random data to ensure
both uniqueness and monotonic ordering properties.
raw docstring

age-millisclj

(age-millis f)

Returns the age of a Flake in milliseconds.

Calculates the time elapsed since the Flake was created.

Returns the age of a Flake in milliseconds.

Calculates the time elapsed since the Flake was created.
sourceraw docstring

age-nanosclj

(age-nanos f)

Returns the age of a Flake in nanoseconds.

Calculates the time elapsed since the Flake was created.

Returns the age of a Flake in nanoseconds.

Calculates the time elapsed since the Flake was created.
sourceraw docstring

as-bytesclj

(as-bytes f)

Returns the byte array representation of a Flake.

Returns a 24-byte array containing the Flake's raw data.

Returns the byte array representation of a Flake.

Returns a 24-byte array containing the Flake's raw data.
sourceraw docstring

as-hexclj

(as-hex f)

Converts a Flake to its hexadecimal representation.

Returns a 48-character lowercase hexadecimal string.

Converts a Flake to its hexadecimal representation.

Returns a 48-character lowercase hexadecimal string.
sourceraw docstring

compare-flakesclj

(compare-flakes f1 f2)

Compare two flakes, returns negative if f1 < f2, zero if equal, positive if f1 > f2

Compare two flakes, returns negative if f1 < f2, zero if equal, positive if f1 > f2
sourceraw docstring

flakeclj

(flake)

Generates a new Flake with current timestamp and random components.

Returns a 192-bit identifier that is guaranteed to be larger than any previously generated Flake in the same thread.

Generates a new Flake with current timestamp and random components.

Returns a 192-bit identifier that is guaranteed to be larger than any
previously generated Flake in the same thread.
sourceraw docstring

flake-bytesclj

(flake-bytes f)

Get the byte array representation of a flake

Get the byte array representation of a flake
sourceraw docstring

flake-stringclj

(flake-string)

Generates a new Flake as a URL-safe string representation.

Returns a 32-character string that preserves the monotonic ordering of the underlying Flake values.

Generates a new Flake as a URL-safe string representation.

Returns a 32-character string that preserves the monotonic ordering
of the underlying Flake values.
sourceraw docstring

flake?clj

(flake? x)

Checks if the given value is a Flake instance.

Checks if the given value is a Flake instance.
sourceraw docstring

from-stringclj

(from-string s)

Parses a Flake from its string representation.

Returns a Flake instance or nil if the input is invalid.

Parses a Flake from its string representation.

Returns a Flake instance or nil if the input is invalid.
sourceraw docstring

make-flakeclj

(make-flake byte-data)
(make-flake timestamp-nanos random-high random-low)

Create a flake with specific timestamp and random components (for testing)

Create a flake with specific timestamp and random components (for testing)
sourceraw docstring

read-flakeclj

(read-flake flake-str)

Reader method for #flake/flake tagged literals.

Reader method for #flake/flake tagged literals.
sourceraw docstring

timestampclj

(timestamp f)

Extracts the timestamp component from a Flake.

Returns the nanosecond timestamp indicating when the Flake was created.

Extracts the timestamp component from a Flake.

Returns the nanosecond timestamp indicating when the Flake was created.
sourceraw docstring

timestamp-millisclj

(timestamp-millis f)

Extracts the timestamp component as milliseconds since epoch.

Converts the nanosecond timestamp to milliseconds for easier interoperability with standard time libraries.

Extracts the timestamp component as milliseconds since epoch.

Converts the nanosecond timestamp to milliseconds for easier
interoperability with standard time libraries.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close