소스 검색

Merge pull request #1013 from jpsim/fix-warnings-with-swift-5.8

Fix warnings with Swift 5.8
Marcin Krzyzanowski 2 년 전
부모
커밋
8f1b2dd48a
2개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      Sources/CryptoSwift/Scrypt.swift
  2. 2 0
      Sources/CryptoSwift/String+Extension.swift

+ 4 - 0
Sources/CryptoSwift/Scrypt.swift

@@ -121,7 +121,11 @@ private extension Scrypt {
 
     /* 1: X <-- B */
     let typedBlock = block.assumingMemoryBound(to: UInt32.self)
+#if compiler(>=5.8)
+    X.update(from: typedBlock, count: 32 * self.r)
+#else
     X.assign(from: typedBlock, count: 32 * self.r)
+#endif
 
     /* 2: for i = 0 to N - 1 do */
     for i in stride(from: 0, to: self.N, by: 2) {

+ 2 - 0
Sources/CryptoSwift/String+Extension.swift

@@ -13,6 +13,8 @@
 //  - This notice may not be removed or altered from any source or binary distribution.
 //
 
+import Foundation
+
 /** String extension */
 extension String {