final class DirectoryPathGenerator (View source)

Derives deterministic bounded-fan-out directory paths from identifiers.

It does not create directories or own storage-root policy.

Methods

string
shard(string|int $key, int|null $depth = null)

Maps an arbitrary key into deterministic two-hex-character directory buckets.

string

Details

shard

string shard(string|int $key, int|null $depth = null)

Maps an arbitrary key into deterministic two-hex-character directory buckets.

It calculates a path only; callers retain ownership of directory creation and storage policy.

Parameters

string|int $key
int|null $depth

Return Value

string