diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-23 15:04:44 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-23 15:04:44 -0600 |
commit | 810fcf99105016f5f55647d326909736c3641702 (patch) | |
tree | be4a46a0e0dccbb6c2dff47afacb0fced646e4b8 /ios/AppSecureRandomModule.m | |
parent | 4eb8bc1249ccf6afaa0c77695057a13379cf1aa1 (diff) | |
download | voidsky-810fcf99105016f5f55647d326909736c3641702.tar.zst |
Remove webcrypto polyfill, as it's no longer needed
Diffstat (limited to 'ios/AppSecureRandomModule.m')
-rw-r--r-- | ios/AppSecureRandomModule.m | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/ios/AppSecureRandomModule.m b/ios/AppSecureRandomModule.m deleted file mode 100644 index 9aba127fc..000000000 --- a/ios/AppSecureRandomModule.m +++ /dev/null @@ -1,27 +0,0 @@ -#import "AppSecureRandomModule.h" - -@implementation AppSecureRandomModule - -RCT_EXPORT_MODULE(); - -+ (BOOL)requiresMainQueueSetup -{ - return NO; -} - -RCT_REMAP_METHOD(generateSecureRandomAsBase64, - withLength:(int)length - resolver:(RCTPromiseResolveBlock)resolve - rejecter:(RCTPromiseRejectBlock)reject) -{ - NSMutableData* bytes = [NSMutableData dataWithLength:length]; - int result = SecRandomCopyBytes(kSecRandomDefault,length, [bytes mutableBytes]); - if (result == errSecSuccess) { - resolve([bytes base64EncodedStringWithOptions:0]); - } else { - NSError *error = [NSError errorWithDomain:@"RNSecureRandom" code:result userInfo: nil]; - reject(@"randombytes_error", @"Error generating random bytes", error); - } -} - -@end |