Use sodium to generate random bytes
This commit is contained in:
parent
a089fd1e3b
commit
a7944a3f93
1 changed files with 1 additions and 5 deletions
|
@ -151,11 +151,7 @@ class CryptoUtil {
|
|||
}
|
||||
|
||||
static Uint8List getSecureRandomBytes({int length = 32}) {
|
||||
return SecureRandom(length).bytes;
|
||||
}
|
||||
|
||||
static String getSecureRandomString({int length = 32}) {
|
||||
return SecureRandom(length).base64;
|
||||
return Sodium.randombytesBuf(length);
|
||||
}
|
||||
|
||||
static Uint8List scrypt(Uint8List plainText, Uint8List salt) {
|
||||
|
|
Loading…
Add table
Reference in a new issue