isAccountId function

bool isAccountId(
  1. String str
)

Implementation

bool isAccountId(String str) {
  if (!isHex(str) || str.length != 64) {
    return false;
  }
  final fullBytes = str.toU8a();
  final view = ByteData(4);
  view.setUint32(0, getCrc32(fullBytes.sublist(4).buffer));
  return fullBytes.sublist(0, 4).eq(view.buffer.asUint8List());
}