Update packageManager & add CryptoSwift

This commit is contained in:
vbodinaud
2020-03-01 03:06:01 +01:00
parent 52ea558811
commit b8847bd8a9
4 changed files with 29 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<true/>
</dict>
</plist>

16
Package.resolved Normal file
View File

@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "CryptoSwift",
"repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift.git",
"state": {
"branch": null,
"revision": "a44caef0550c346e0ab9172f7c9a3852c1833599",
"version": "1.3.0"
}
}
]
},
"version": 1
}

View File

@@ -8,15 +8,16 @@ let package = Package(
dependencies: [ dependencies: [
// Dependencies declare other packages that this package depends on. // Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"), // .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.0.0"),
], ],
targets: [ targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on. // Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target( .target(
name: "Blockchain", name: "Blockchain",
dependencies: []), dependencies: ["CryptoSwift"]),
.testTarget( .testTarget(
name: "BlockchainTests", name: "BlockchainTests",
dependencies: ["Blockchain"]), dependencies: ["Blockchain", "CryptoSwift"]),
] ]
) )

View File

@@ -7,6 +7,7 @@
// //
import Foundation import Foundation
import CryptoSwift
class Block { class Block {
var hash: String! var hash: String!
@@ -15,6 +16,6 @@ class Block {
var index: Int! var index: Int!
func generateHash() -> String { func generateHash() -> String {
return NSUUID().uuidString.replacingOccurrences(of: "-", with: "") return data.sha256()
} }
} }