5 // Created by Mitch Adler on 4/15/16.
9 #import <Foundation/Foundation.h>
10 #import <NSData+SecRandom.h>
12 #include <Security/SecRandom.h>
14 @implementation NSMutableData (SecRandom)
16 + (instancetype) dataWithRandomBytes: (int) length {
18 NSMutableData* result = [NSMutableData dataWithLength: length];
20 if (0 != SecRandomCopyBytes(kSecRandomDefault, result.length, result.mutableBytes))