Functions
assertValidBaseString
assertValidBaseString(
alphabet
,testValue
,givenValue?
):void
Asserts that a given string contains only characters from the specified alphabet.
This function validates whether a string consists exclusively of characters
from the provided alphabet
. If the validation fails, it throws an error
indicating the invalid base string.
Parameters
Parameter | Type | Description |
---|---|---|
alphabet | string | The allowed set of characters for the base encoding. |
testValue | string | The string to validate against the given alphabet. |
givenValue? | string | The original string provided by the user (defaults to testValue ). |
Returns
void
Throws
If testValue
contains characters not present in alphabet
.
Example
Validating a base-8 encoded string.