Skip to main content

FixedLengthUniqueIDForParts

FixedLengthUniqueIDForParts creates a new uniqueID using the parts concatenated using - and ensures that the uniqueID is not longer than the maxLength. In case a simple concatenation yields a longer string, a new hashed ID is created which is always around 8 characters in length.

def FixedLengthUniqueIDForParts(
maxLength: int,
parts: list,
options: list
) - > string

Creates a new unique ID by concatenating provided parts with hyphens. If the resulting unique ID exceeds the specified maximum length, a new hashed ID, approximately 8 characters long, is generated instead.

Parameters

NameTypeDescription
maxLengthintThe maximum allowed length for the unique ID. If the concatenated parts exceed this length, a hashed ID is generated.
partslistA list of strings that will be concatenated to form the base unique ID.
optionslistOptional parameters to configure the unique ID generation process.

Returns

TypeDescription
stringThe unique ID, which is either the hyphen-separated parts or a hashed ID if the former exceeds maxLength.