toCodeName function

String toCodeName(
  1. String str
)

convert to the code-name

Implementation

String toCodeName(String str) {
  final bytes = utf8.encode(str);
  final typedBytes = Uint8List.fromList(bytes);
  final encoded = base32.encode(typedBytes);
  final lowerCase = encoded.toLowerCase();
  final prefixAdded = '$_prefix$lowerCase';
  final escaped = prefixAdded.replaceAll('=', _escape);
  return escaped;
}