Home Assistant Unofficial Reference 2024.12.1
homeassistant.util.ulid Namespace Reference

Functions

str ulid (float|None timestamp=None)
 

Variables

list __all__
 

Detailed Description

Helpers to generate ulids.

Function Documentation

◆ ulid()

str homeassistant.util.ulid.ulid ( float | None   timestamp = None)
Generate a ULID.

This ulid should not be used for cryptographically secure
operations.

 01AN4Z07BY      79KA1307SR9X4MV3
|----------|    |----------------|
 Timestamp          Randomness
   48bits             80bits

This string can be loaded directly with https://github.com/ahawker/ulid

import homeassistant.util.ulid as ulid_util
import ulid
ulid.parse(ulid_util.ulid())

Definition at line 27 of file ulid.py.

Variable Documentation

◆ __all__

list homeassistant.util.ulid.__all__
private
Initial value:
1 = [
2  "ulid",
3  "ulid_hex",
4  "ulid_at_time",
5  "ulid_to_bytes",
6  "bytes_to_ulid",
7  "ulid_now",
8  "ulid_to_bytes_or_none",
9  "bytes_to_ulid_or_none",
10 ]

Definition at line 15 of file ulid.py.