Skip to main content

FixedLengthUniqueID

FixedLengthUniqueID creates a new UniqueID that is based on the inputID and of a specified length, if the given id is longer than the maxLength.

def FixedLengthUniqueID(
inputID: string,
maxLength: int,
options: ...Option
) - > string, error

Creates a new UniqueID that is based on the inputID and of a specified length, if the given id is longer than the maxLength.

Parameters

NameTypeDescription
inputIDstringThe original ID string to be processed.
maxLengthintThe maximum desired length for the unique ID. If the inputID is longer than this, it will be hashed and truncated.
options...OptionOptional parameters to configure the hashing algorithm. If not provided, a default 32-bit FNV hash is used.

Returns

TypeDescription
string, errorThe unique ID string, or an error if the maxLength is too small to encode the ID.