I started learning Swift for iOS development but I face a problem which didn't exist on Android.
private static byte[] randomBytes(int length) {
SecureRandom random = new SecureRandom();
byte[] b = new byte[length];
random.nextBytes(b);
return b;
}
With this I generate random bytes on Android.
then I use this to get a String from it.
byte[] byteV = randomBytes(16);
String IV_string = new String(byteV);
How can I do the same with Swift 5 ?