使用MD5加密串,for16字节UInt8数组,但我也需要ASCII值,如何在swift 3.0中将UInt8转换为ASCII值
发布于 2017-04-16 08:10:27
尝试如下所示:
let asciiBytes: [UInt8] = [77,105,99,104,97,101,108]
let s = String(bytes: asciiBytes, encoding: .ascii)
print(s) // prints "Michael"发布于 2017-01-11 20:50:23
大多数数据字节没有ASCII表示,请参阅Martin的注释。
如果需要以ASCII码表示数据,常用的方法是将其编码为Base64或十六进制。
https://stackoverflow.com/questions/41585416
复制相似问题