Validates a HexaURL string against configurable rules.


Performs validation checks in the following order:

  1. Length constraints (min/max) - throws InvalidLength error if minLength is greater than calculated max length
  2. Character composition based on identifier type
  3. Delimiter rules for hyphens and underscores

Default configuration:

  • Minimum length: 3 characters
  • Maximum length: Based on byteSize parameter (16 bytes = 21 characters)
  • Allowed chars: Alphanumeric with hyphens only
  • Strict delimiter rules:
    • No leading/trailing delimiters
    • No consecutive delimiters
    • No adjacent hyphen-underscore pairs

If any validation rule is violated, with specific error code and message

  • Parameters

    • input: string

      The HexaURL string to validate

    • config: Config = ...

      Optional configuration for validation rules

    • byteSize: number = 16

      The target byte array size after encoding (default 16)

    Returns void