v2 #12

Merged
hugo merged 21 commits from v2 into master 2023-04-05 15:03:47 +00:00
Showing only changes of commit 5be6296829 - Show all commits

View File

@ -31,7 +31,8 @@ public class NativeCrypto: NSObject, NativeCryptoAPI {
func generateSecureRandom(length: Int64) throws -> FlutterStandardTypedData? {
let lengthInt = Int(truncatingIfNeeded: length)
let symmetricKey = SymmetricKey.init(size: SymmetricKeySize(bitCount: lengthInt / 8))
let bitCount = lengthInt * 8
let symmetricKey = SymmetricKey.init(size: SymmetricKeySize(bitCount: bitCount))
let bytes = symmetricKey.withUnsafeBytes
{
return Data(Array($0))