How to convert hexadecimal string to an array of UInt8 bytes in Swift?

后端 未结 3 685
灰色年华
灰色年华 2020-12-03 17:37

I have the following code:

var encryptedByteArray: Array?
do {
    let aes = try AES(key: \"passwordpassword\", iv: \"drowssapdrowssap\")
    e         


        
3条回答
  •  再見小時候
    2020-12-03 18:30

    Swift 5

    import CryptoSwift
    
    let hexString = "e0696349774606f1b5602ffa6c2d953f"
    let hexArray = Array.init(hex: hexString) // [224, 105, 99, 73, 119, 70, 6, 241, 181, 96, 47, 250, 108, 45, 149, 63]
    

提交回复
热议问题