Skip to content

Commit

Permalink
fix: slow performance on derivationKey method. Closes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfttorres authored Sep 20, 2018
1 parent 019f91d commit 6a463a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ios/RCTPBKDF2/RCTPBKDF2.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ @implementation RCTPBKDF2

RCT_EXPORT_MODULE()

RCT_EXPORT_METHOD(derivationKey:(NSString *)password salt:(NSString *)salt iterations:(nonnull NSNumber *)iterations
RCT_EXPORT_METHOD(derivationKey:(NSString *)password salt:(NSString *)salt iterations:(nonnull int *)iterations
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {
NSError *error = nil;
Expand Down
2 changes: 1 addition & 1 deletion ios/RCTPBKDF2/lib/PBKDF2.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>

@interface PBKDF2 : NSObject
+ (NSString *) derivationKey:(NSString *)password salt: (NSString *)salt iterations: (nonnull NSNumber *)iterations;
+ (NSString *) derivationKey:(NSString *)password salt: (NSString *)salt iterations: (nonnull int *)iterations;
+ (NSString *) toHex: (NSData *)nsdata;
@end
2 changes: 1 addition & 1 deletion ios/RCTPBKDF2/lib/PBKDF2.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ + (NSString *) toHex:(NSData *)nsdata {
return hexStr;
}

+ (NSString *) derivationKey:(NSString *)password salt: (NSString *)salt iterations: (nonnull NSNumber *)iterations {
+ (NSString *) derivationKey:(NSString *)password salt: (NSString *)salt iterations: (nonnull int *)iterations {
// Data of String to generate Hash key(hexa decimal string).
NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding];
NSData *saltData = [salt dataUsingEncoding:NSUTF8StringEncoding];
Expand Down

0 comments on commit 6a463a9

Please sign in to comment.