UUIDs

UUIDs.uuid1 — Function.

  1. uuid1([rng::AbstractRNG=GLOBAL_RNG]) -> UUID

Generates a version 1 (time-based) universally unique identifier (UUID), as specified by RFC 4122. Note that the Node ID is randomly generated (does not identify the host) according to section 4.5 of the RFC.

Examples

  1. julia> rng = MersenneTwister(1234);
  2. julia> uuid1(rng)
  3. UUID("cfc395e8-590f-11e8-1f13-43a2532b2fa8")

source

UUIDs.uuid4 — Function.

  1. uuid4([rng::AbstractRNG=GLOBAL_RNG]) -> UUID

Generates a version 4 (random or pseudo-random) universally unique identifier (UUID), as specified by RFC 4122.

Examples

  1. julia> rng = MersenneTwister(1234);
  2. julia> uuid4(rng)
  3. UUID("196f2941-2d58-45ba-9f13-43a2532b2fa8")

source

UUIDs.uuid5 — Function.

  1. uuid5(ns::UUID, name::String) -> UUID

Generates a version 5 (namespace and domain-based) universally unique identifier (UUID), as specified by RFC 4122.

Julia 1.1

This function requires at least Julia 1.1.

Examples

  1. julia> rng = MersenneTwister(1234);
  2. julia> u4 = uuid4(rng)
  3. UUID("196f2941-2d58-45ba-9f13-43a2532b2fa8")
  4. julia> u5 = uuid5(u4, "julia")
  5. UUID("b37756f8-b0c0-54cd-a466-19b3d25683bc")

source

UUIDs.uuid_version — Function.

  1. uuid_version(u::UUID) -> Int

Inspects the given UUID and returns its version (see RFC 4122).

Examples

  1. julia> uuid_version(uuid4())
  2. 4

source