func stringSha1(_ value: String) -> String {
let cstr = value.cString(using: String.Encoding.utf8)
let data = Data(bytes: cstr, length: (value.characters.count ?? 0))
let digest = [UInt8](repeating: 0, count: Int(CC_SHA1_DIGEST_LENGTH))
// This is an iOS5-specific method.
// It takes in the data, how much data, and then output format, which in this case is an int array.
CC_SHA1(data.bytes, (data.count as? uint), digest)
//NSLog(@"SHA1 Digest: %s",digest);
return stringHexEncode(digest, withLength: CC_SHA1_DIGEST_LENGTH)
}
он показывает такую ошибку: метки аргументов «(bytes:, length:)» не соответствуют ни одной из доступных перегрузок.