1

I am trying to implement DES algorithm in Swift. And to do that, I need to convert my text string, ex. "Hello, world" into Hex string. I've found out here about this way

var text = "Hello, world!"
let data = text.data(using: String.Encoding.utf16)
data?.base64EncodedString()

But base64EncodeString() obviously does not return what I need. What should I do to get something like

48656c6c6f2c20776f726c6421  
Community
  • 1
  • 1
Artem Misesin
  • 373
  • 3
  • 13

0 Answers0