Update packageManager & add CryptoSwift
This commit is contained in:
@@ -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
16
Package.resolved
Normal 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
|
||||
}
|
||||
@@ -8,15 +8,16 @@ let package = Package(
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
// 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.
|
||||
.target(
|
||||
name: "Blockchain",
|
||||
dependencies: []),
|
||||
dependencies: ["CryptoSwift"]),
|
||||
.testTarget(
|
||||
name: "BlockchainTests",
|
||||
dependencies: ["Blockchain"]),
|
||||
dependencies: ["Blockchain", "CryptoSwift"]),
|
||||
]
|
||||
)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CryptoSwift
|
||||
|
||||
class Block {
|
||||
var hash: String!
|
||||
@@ -15,6 +16,6 @@ class Block {
|
||||
var index: Int!
|
||||
|
||||
func generateHash() -> String {
|
||||
return NSUUID().uuidString.replacingOccurrences(of: "-", with: "")
|
||||
return data.sha256()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user