hashedKeyFor method

Uint8List hashedKeyFor(
  1. K1 key1,
  2. K2 key2,
  3. K3 key3,
  4. K4 key4,
  5. K5 key5,
  6. K6 key6,
)

Implementation

Uint8List hashedKeyFor(K1 key1, K2 key2, K3 key3, K4 key4, K5 key5, K6 key6) {
  final Uint8List hash = Uint8List(32 +
      hasher1.size(key1) +
      hasher2.size(key2) +
      hasher3.size(key3) +
      hasher4.size(key4) +
      hasher5.size(key5) +
      hasher6.size(key6));
  Hasher.twoxx128.hashTo(
    data: Uint8List.fromList(utf8.encode(prefix)),
    output: hash.buffer.asUint8List(hash.offsetInBytes, 16),
  );
  Hasher.twoxx128.hashTo(
    data: Uint8List.fromList(utf8.encode(storage)),
    output: hash.buffer.asUint8List(hash.offsetInBytes + 16, 16),
  );
  int cursor = hash.offsetInBytes + 32;
  hasher1.hashTo(key: key1, output: hash.buffer.asUint8List(cursor));
  cursor += hasher1.size(key1);
  hasher2.hashTo(key: key2, output: hash.buffer.asUint8List(cursor));
  cursor += hasher2.size(key2);
  hasher3.hashTo(key: key3, output: hash.buffer.asUint8List(cursor));
  cursor += hasher3.size(key3);
  hasher4.hashTo(key: key4, output: hash.buffer.asUint8List(cursor));
  cursor += hasher4.size(key4);
  hasher5.hashTo(key: key5, output: hash.buffer.asUint8List(cursor));
  cursor += hasher5.size(key5);
  hasher6.hashTo(key: key6, output: hash.buffer.asUint8List(cursor));
  return hash;
}