Do not instantiate SecureRandom on every call (#58)

This commit is contained in:
TonCherAmi 2021-12-17 11:22:51 +03:00 committed by GitHub
parent 735a71c9cd
commit d55d9bd600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -24,6 +24,6 @@ object SecureRandomStringGenerator {
}
}
fun generateRandomBytes(size: Int) = ByteArray(size).also(SecureRandom()::nextBytes)
fun generateRandomBytes(size: Int) = ByteArray(size).also(secureRandom::nextBytes)
}