generate static method
Generates a random salt of length
bytes from a cryptographically secure
random number generator.
Each element of this list is a byte.
Implementation
static List<int> generate(int length) {
final Uint8List buffer = Uint8List(length);
final Random rng = Random.secure();
for (int i = 0; i < length; i++) {
buffer[i] = rng.nextInt(256);
}
return buffer;
}