You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extensionString{func tlsBase64URLDecode()->String{letstr=replacingOccurrences(of:"_", with:"=").replacingOccurrences(of:"-", with:"/").replacingOccurrences(of:"*", with:"+")
guard let data =Data(base64Encoded: str),let decodeStr =String(data: data, encoding:.utf8)else{return str
}return decodeStr
}func tlsBase64URLDecode()->String{
guard let urlEncodeData =self.data(using:.utf8)else{returnself}varbytes=[UInt8](urlEncodeData)
for (index,byte) in bytes.enumerated(){
if byte ==0x5f{bytes[index]=0x3d}else if byte ==0x2d{bytes[index]=0x2f}else if byte ==0x2a{bytes[index]=0x2b}}print(String(bytes: bytes, encoding:.utf8))
if let decodeData =Data(base64Encoded:Data(bytes: bytes)),let decodeStr =String(data: decodeData, encoding:.utf8){return decodeStr
}returnself}
No description provided.
The text was updated successfully, but these errors were encountered: