We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d4c7e4 commit d55dcdeCopy full SHA for d55dcde
swift-sdk/Internal/ClassExtensions.swift
@@ -37,16 +37,6 @@ public extension Bundle {
37
public extension Data {
38
//from: https://stackoverflow.com/questions/39075043/how-to-convert-data-to-hex-string-in-swift
39
func hexString() -> String {
40
- let digits = Array("01234567890abcdef".utf16)
41
-
42
- var chars: [UniChar] = []
43
- chars.reserveCapacity(count * 2)
44
45
- for byte in self {
46
- chars.append(digits[Int(byte / 16)])
47
- chars.append(digits[Int(byte % 16)])
48
- }
49
50
- return String(utf16CodeUnits: chars, count: chars.count)
+ return map { String(format: "%02.2hhx", $0) }.joined()
51
}
52
0 commit comments