Ich verwende die folgende Methode um das Passwort zu hashen:
Alles anzeigen
Allerdings bekomme ich immer eine Warnung in Zeile 9. Ich hab einen Screenshot davon im Anhang.
Wisst ihr woran das liegt?
Quellcode
- -(NSString *)generateSHA256:(NSString *)inputString{
- NSString *passwordWithSalt = [NSString stringWithFormat:@"%@%@", @"THESALT", inputString];
- NSMutableString *passwordHash = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH];
- unsigned char passwordChars[CC_SHA256_DIGEST_LENGTH];
- CC_SHA256([passwordWithSalt UTF8String],[passwordWithSalt lengthOfBytesUsingEncoding:NSUTF8StringEncoding], passwordChars);
- for(int i=0; i< CC_SHA256_DIGEST_LENGTH; i++){
- [passwordHash appendString:[NSString stringWithFormat:@"%02x", passwordChars[i]]];
- }
- return passwordHash;
- }
Allerdings bekomme ich immer eine Warnung in Zeile 9. Ich hab einen Screenshot davon im Anhang.
Wisst ihr woran das liegt?