react-native-security-suite 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -193,4 +193,21 @@ extension Data {
|
|
|
193
193
|
|
|
194
194
|
return Data(result)
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
var urlsafeBase64: Data {
|
|
198
|
+
let r: [UInt8] = self
|
|
199
|
+
.compactMap {
|
|
200
|
+
switch $0 {
|
|
201
|
+
case UInt8(ascii: "+"):
|
|
202
|
+
return UInt8(ascii: "-")
|
|
203
|
+
case UInt8(ascii: "/"):
|
|
204
|
+
return UInt8(ascii: "_")
|
|
205
|
+
case UInt8(ascii: "="):
|
|
206
|
+
return nil
|
|
207
|
+
default:
|
|
208
|
+
return $0
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return Data(r)
|
|
212
|
+
}
|
|
196
213
|
}
|
|
Binary file
|