Last active
December 6, 2018 12:22
-
-
Save Vedroid36/7a8a342a3da1fe4034b0ceff5e040cd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(NSString *)_bCryptPassword:(NSString* )password withSaltData:(NSData *)saltData { | |
char keybuf[61]; | |
char settingbuf[30]; | |
const char *genkey, *setting; | |
const char *cPassword = [password cStringUsingEncoding:NSUTF8StringEncoding]; | |
setting = _crypt_gensalt_blowfish_rn(“$2b$“, 14, [saltData bytes], 20, settingbuf, sizeof(settingbuf)); | |
if (!setting) | |
return @“”; | |
genkey = _crypt_blowfish_rn(cPassword, setting, keybuf, sizeof(keybuf)); | |
if (!genkey) | |
return @“”; | |
return [NSString stringWithCString:keybuf encoding:NSUTF8StringEncoding]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment