urlSafe method

String urlSafe({
  1. int length = 21,
  2. String excludedCharSet = '',
})

Generate an ID using the standard URL-safe Base64 charset.

length: Number of characters in the generated ID (default is 21). excludedCharSet: Characters to exclude from the default charset.

Implementation

String urlSafe({int length = 21, String excludedCharSet = ''}) {
  return _generate(
    length: length,
    charSet: NanoIDCharset.urlSafe,
    excludedCharSet: excludedCharSet,
  );
}