Salt.newSalt constructor

Salt.newSalt({
  1. int length = 16,
})

Factory constructor to create a salt with random bytes. Optionally accepts a length of type int to create salts of a length that the user inputs.

Implementation

factory Salt.newSalt({int length = 16}) {
  return Salt(_getRandomBytes(16));
}