bsfs.utils.uuid module#

class bsfs.utils.uuid.UCID#

Bases: object

Generate 256-bit content IDs.

Effectively computes a cryptographic hash over the content.

static from_buffer(buffer: IOBase) str#

Read the content from a buffer.

static from_bytes(content: bytes) str#

Get the content from as bytes.

static from_dict(content: dict) str#

Get the content from a dict.

static from_path(path: str) str#

Read the content from a file.

class bsfs.utils.uuid.UUID(seed: int | None = None)#

Bases: Iterator, Callable

Generate 256-bit universally unique IDs.

This is a ‘best-effort’ kind of implementation that tries to ensure global uniqueness, even tough actual uniqueness cannot be guaranteed. The approach is different from python’s uuid module (which implements RFC 4122) in that it generates longer UUIDs and in that it cannot be reconstructed whether two UUIDs were generated on the same system.

The ID is a cryptographic hash over several components: * host * system * process * thread * random * time * cpu cycles * content (if available)

host: str#
process: str#
system: str#
thread: str#