Check out example codes for "how to recieve hex value from NSData swift". It will help you in understanding the concepts better.

Code Example 1

extension NSData {

    func hexString() -> String {
        return UnsafeBufferPointer<UInt8>(start: UnsafePointer<UInt8>(bytes), count: length)
            .reduce("") { $0 + String(format: "%02x", $1) }
    }

}

Learn ReactJs, React Native from akashmittal.com