toAccountID method

Uint8List toAccountID()

Implementation

Uint8List toAccountID() {
  final hash = SHA224();
  hash.update(('\x0Aaccount-id').plainToU8a());
  hash.update(toBlob());
  hash.update(Uint8List(32));
  final data = hash.digest();
  final view = ByteData(4);
  view.setUint32(0, getCrc32(data.buffer));
  final checksum = view.buffer.asUint8List();
  final bytes = Uint8List.fromList(data);
  return Uint8List.fromList([...checksum, ...bytes]);
}