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
| Name | Type | Description |
|---|---|---|
| inputID | string | The original ID string to be processed. |
| maxLength | int | The maximum desired length for the unique ID. If the inputID is longer than this, it will be hashed and truncated. |
| options | ...Option | Optional parameters to configure the hashing algorithm. If not provided, a default 32-bit FNV hash is used. |
Returns
| Type | Description |
|---|---|
string, error | The unique ID string, or an error if the maxLength is too small to encode the ID. |