diff --git a/Tests/CryptoTests/Digests/DigestsTests.swift b/Tests/CryptoTests/Digests/DigestsTests.swift index 7eb02cf7..e706af44 100644 --- a/Tests/CryptoTests/Digests/DigestsTests.swift +++ b/Tests/CryptoTests/Digests/DigestsTests.swift @@ -113,6 +113,7 @@ class DigestsTests: XCTestCase { try orFail { try testHashFunctionImplementsCoW(hf: SHA512.self) } } + @available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, *) func testBlockSizes() { XCTAssertEqual(Insecure.MD5.blockByteCount, 64) XCTAssertEqual(Insecure.SHA1.blockByteCount, 64) diff --git a/Tests/_CryptoExtrasTests/Utils/BytesUtil.swift b/Tests/_CryptoExtrasTests/Utils/BytesUtil.swift index e87e2e2d..a01b0db9 100644 --- a/Tests/_CryptoExtrasTests/Utils/BytesUtil.swift +++ b/Tests/_CryptoExtrasTests/Utils/BytesUtil.swift @@ -60,7 +60,7 @@ extension DataProtocol { var hexString: String { get { let hexLen = self.count * 2 - return String.init(unsafeUninitializedCapacity: hexLen) { buf in + let bytes = Array(unsafeUninitializedCapacity: hexLen) { buf, count in var offset = 0 self.regions.forEach { (_) in @@ -70,8 +70,9 @@ extension DataProtocol { offset += 1 } } - return offset + count = offset } + return String(decoding: bytes, as: UTF8.self) } } }