Riak Core: Unique Identifiers

To generate a unique identifier, Riak Core exposes:

riak_core_util:unique_id_62()

Which returns a string that looks like this:

NWX8ZV4Zn4pfZDh51viJtpyya9v

The full function can be seen below:

%% @spec unique_id_62() -> string()
%% @doc Create a random identifying integer, returning its string
%%      representation in base 62.
unique_id_62() -> Rand
crypto:sha
term_to_binary({
make_ref()
os:timestamp()})), = Rand,
integer_to_list(I, 62).

Join the Newsletter

My newsletter is where you'll find exclusive content from me. I write about technology, startups, and why you shouldn't call yourself a junior engineer

Web Mentions