I am using OpenSSL Library compiled for IOS project. So I need to calculate ripemd160 hash. From RIPEMD160 function, I got 20 bytes array, and not the hash. But I need hash like this: 6c9814cf2a93131c8d3263158896e786de7a3f21. How I can achieve this? Please help who knows C and Swift. Thanks.
Update: Thanks @MartinR and his comment. Accepted answer helped. Here stackoverflow.com/q/39075043/1187415
let publicKey = "04981891480BC21B0AFE20FAF8F49FB1618E80769D0956A730B8409E856CB9512B4778CB346C211065050E008412C29B0474EA56AEA3761DBD75655B4FBD252E39"
var md = [UInt8](repeating: 0, count: Int(RIPEMD160_DIGEST_LENGTH))
let PubKeyBuf = [UInt8](publicKey.utf8)
let sha256Desc = SHA256.hash(data: PubKeyBuf).description
let startIndex = sha256Desc.index(sha256Desc.endIndex, offsetBy: -64)
let SHA256 = String(sha256Desc[startIndex..<sha256Desc.endIndex])
var d = [UInt8](SHA256.utf8)
RIPEMD160(&d, Int(RIPEMD160_DIGEST_LENGTH), &md)
print(md) // returns [219, 95, 117, 159, 78, 53, 169, 215, 52, 42, 30, 65, 216, 160, 91, 92, 59, 233, 33, 76]```