Movatterモバイル変換


[0]ホーム

URL:


GitHub

UUIDs

UUIDs.uuid1Function
uuid1([rng::AbstractRNG]) -> 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.

The default rng used byuuid1 is notRandom.default_rng() and every invocation ofuuid1() without an argument should be expected to return a unique identifier. Importantly, the outputs ofuuid1 do not repeat even whenRandom.seed!(seed) is called. Currently (as of Julia 1.6),uuid1 usesRandom.RandomDevice as the default rng. However, this is an implementation detail that may change in the future.

Julia 1.6

The output ofuuid1 does not depend onRandom.default_rng() as of Julia 1.6.

Examples

julia> using Randomjulia> rng = MersenneTwister(1234);julia> uuid1(rng)UUID("cfc395e8-590f-11e8-1f13-43a2532b2fa8")
UUIDs.uuid4Function
uuid4([rng::AbstractRNG]) -> UUID

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

The default rng used byuuid4 is notRandom.default_rng() and every invocation ofuuid4() without an argument should be expected to return a unique identifier. Importantly, the outputs ofuuid4 do not repeat even whenRandom.seed!(seed) is called. Currently (as of Julia 1.6),uuid4 usesRandom.RandomDevice as the default rng. However, this is an implementation detail that may change in the future.

Julia 1.6

The output ofuuid4 does not depend onRandom.default_rng() as of Julia 1.6.

Examples

julia> using Randomjulia> rng = Xoshiro(123);julia> uuid4(rng)UUID("856e446e-0c6a-472a-9638-f7b8557cd282")
UUIDs.uuid5Function
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

julia> using Randomjulia> rng = Xoshiro(123);julia> u4 = uuid4(rng)UUID("856e446e-0c6a-472a-9638-f7b8557cd282")julia> u5 = uuid5(u4, "julia")UUID("2df91e3f-da06-5362-a6fe-03772f2e14c9")
UUIDs.uuid_versionFunction
uuid_version(u::UUID) -> Int

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

Examples

julia> uuid_version(uuid4())4

Settings


This document was generated withDocumenter.jl version 1.8.0 onWednesday 9 July 2025. Using Julia version 1.11.6.


[8]ページ先頭

©2009-2025 Movatter.jp