How to convert Data to hex string in swift

前端 未结 7 1944
走了就别回头了
走了就别回头了 2020-11-22 07:59

I want the hexadecimal representation of a Data value in Swift.

Eventually I\'d want to use it like this:

let data = Data(base64Encoded: \"aGVsbG8gd2         


        
相关标签:
7条回答
  • 2020-11-22 08:31

    Maybe not the fastest, but data.map({ String($0, radix: 16) }).joined() does the job. As mentioned in the comments, this solution was flawed.

    0 讨论(0)
提交回复
热议问题