isByteString function
Implementation
bool isByteString(String byStr, {required int length}) {
var str = byStr.startsWith(RegExp(r'0x', caseSensitive: false))
? byStr.substring(2)
: byStr;
return validators.matches(str, '^[0-9a-fA-F]{$length}') &&
validators.isLength(str, length, length);
}