ashiqsulaimanbaryons ashiqsulaimanbaryons - 3 months ago
178 0

let bytes = [24, 61, 96, 30, 58, 220, 165, 189, 67, 220, 221, 121, 205, 159, 109, 244, 74, 252, 222, 202, 145, 79, 158, 9, 13, 187, 200, 89, 129, 253, 162, 75]

//Convert [UInt8] to NSData
let data = NSData(bytes: bytes, length: bytes.count)
print("the data is (data)")

// //Convert NSData to NSString
let newNSString = NSString(data: data, encoding: NSUTF8StringEncoding)

Swift

[Uint-8] to String always returning nil.

The bytes array is an [UInt-8] which is a HMAC Sha256. But every set of bytes i convert to String returns me a nil.