hashedKeyFor method
Uint8List
hashedKeyFor(
- K1 key1,
- K2 key2,
- K3 key3
)
Implementation
Uint8List hashedKeyFor(K1 key1, K2 key2, K3 key3) {
final Uint8List hash = Uint8List(
32 + hasher1.size(key1) + hasher2.size(key2) + hasher3.size(key3));
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));
return hash;
}