Table of Contents

HalfUlid Class

Namespace
SatorImaging.HUlid
public static class HalfUlid

Half-ULID (HUlid) is a 64-bit (long) shrinked version of ULID. Max 2,097,152 of IDs can be created for every milliseconds.

Inheritance
HalfUlid

Fields

DEFAULT_START_VALUE
DEFAULT_YEAR_ORIGIN
ID_MAX
MinValue
RANDOM_ID_BITMASK
RANDOM_ID_MAX
RANDOM_ID_SEQ_BIT_LENGTH
YEAR_MAX
YEAR_USE_CURRENT

Properties

CurrentOriginYear

Methods

GetDateTime(long, int)
GetRandomBits(long)
GetTimeBits(DateTime)
GetValue(long)
GetValueWithoutRandomBits(long)
Init()

Initialize creation time used for subsequent Next(int) or Random() calls.

Init(int, int)

Initialize creation time used for subsequent Next(int) or Random() calls.

New(bool)

Set creation date and generate new Half-ULID. (shorthand for Init(); Next/Random();)

Next(int)

Generate sequential Half-ULID value.

Random()

Generate Half-ULID using random number and sequential value.

SetCreationTime(DateTime)
ToHUlidDateTime(long, int)
ToHUlidValue(long)
TryGetDateTime(long, out DateTime, int)
TryGetRandomBits(long, out int)
TryGetValue(long, out int)
TryGetValueWithoutRandomBits(long, out int)