Package-level declarations

Types

Link copied to clipboard

This serializer is useful with binary formats to reduce size. You may also use it with text formats like json, but it is not that useful (because there will be no size gain) and a serialized Uuid is not human-readable.

Link copied to clipboard
data object UuidParceler : Parceler<Uuid>

Properties

Link copied to clipboard

13-bits non-negative number representing a sequence number or a random number depending on Uuid version and variant.

Link copied to clipboard

Uuid variant specified and documented by the RFC

Link copied to clipboard
Link copied to clipboard

Node Uuid part, a 48-bit non-negative number. Depending on version and variant it could be one of the following:

Link copied to clipboard

A 60-bits non-negative number. Depending on the Uuid version it could have different semantics:

Link copied to clipboard

The Uuidv7 48 bit big-endian unsigned number of Unix epoch timestamp in milliseconds

Link copied to clipboard

Uuid variant in range [0..7], similar to version

Link copied to clipboard

Uuid numeric version in range [0..15]

Link copied to clipboard

Uuid numeric version in range [0..15]

Functions

Link copied to clipboard
fun Uuid.Companion.from(versionNumber: Int, timeStamp: Long, clockSequence: Int, node: Long, variant: Int = 5): Uuid

Creates an instance of Uuid from components

Link copied to clipboard

Generates a Uuid instance by input bytes applying SHA-1. It doesn't use any random source, so it will produce the same result for the same input values.

fun Uuid.Companion.generateUuid(namespace: Uuid, name: String): Uuid

Generates a Uuid instance by namespace and name applying SHA-1. It doesn't use any random source, so it will produce the same result for the same input values.

Link copied to clipboard

Check the spec string to conform to Uuid

Link copied to clipboard

Generates a random Uuid v4 using this Random instance.

Link copied to clipboard

Generates a random Uuid v4 using the specified random source.

Link copied to clipboard
fun <Error class: unknown class>.toKotlinUuid(): <Error class: unknown class>

Converts this NSUUID value to a Uuid value by using the platform.Foundation.NSUUID.UUIDString representation.

Link copied to clipboard
fun <Error class: unknown class>.toNsUUID(): <Error class: unknown class>

Converts this Uuid value to a NSUUID value by using the default kotlin.uuid.Uuid.toString representation.

Link copied to clipboard

Convert this String to a Uuid, or throws a IllegalArgumentException if this is a malformed Uuid.

Link copied to clipboard

Convert this String to a Uuid, or returns null if this is a malformed Uuid.

Link copied to clipboard
fun Uuidv7(timeStamp: Long, random: Random): Uuid

An Uuidv7 implementation according to the draft.