Bunix

EUUID

An Erlang implementation of the Universally Unique IDentifier (UUID) URN Namespace as defined in RFC 4122. This module implements the UUID versions 1, 3, 4 and 5. It also implements a custom time based UUID that is based on version 1 but has a different layout to allow easy sorting on the creation date.

Usage

> euuid:start().
ok

> euuid:v1().
154506924620507745341751420074171965700

> euuid:format(euuid:v1()).
"888fd0b0-b46c-11df-85e8-6fb918f22104"

> euuid:format(euuid:v5(euuid:ns_dns(), "example.com")).
"cfbff0d1-9375-5685-968c-48ce8b15ae17"

> euuid:format(euuid:time_custom()).
"1dfb46dc-6556-f54e-85e8-6fb918f22104"

> euuid:format(euuid:nil()).
"00000000-0000-0000-0000-000000000000"

> euuid:stop().
ok

Miscellaneous