Skip to content

Commit d105e80

Browse files
committed
Format and update CI
1 parent ee0458e commit d105e80

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Test
1+
name: Lint, Build & Test
22
on:
33
push:
44
branches: [ main ]

Sources/Bcrypt/BcryptVersion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public enum BcryptVersion {
2727
var identifier: [UInt8] {
2828
[.separator, majorVersion, minorVersion, .separator] // $2x$
2929
}
30-
30+
3131
init(identifier: [UInt8]) {
3232
switch identifier {
3333
case [0x32, 0x61]: self = .v2a

Sources/Bcrypt/Verifier.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ struct Verifier {
22
@inlinable
33
public func verify(password: [UInt8], hash goodHash: [UInt8]) throws -> Bool {
44
let prefix = goodHash.prefix(7)
5-
5+
66
let version = BcryptVersion(identifier: Array(prefix[1...2]))
77
let cost = prefix[4...5].reduce(0) { $0 * 10 + Int($1 - 48) }
8-
8+
99
let salt = Array(goodHash[7...28])
10-
10+
1111
let hasher = Hasher(version: version)
1212
let newHash = try hasher.hash(password: password, cost: cost, salt: salt)
1313

Tests/BcryptTests/BcryptTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ struct BcryptTests {
6464
"Expected: \(testVector.expectedHash), got: \(String(decoding: hash, as: UTF8.self))")
6565
}
6666
}
67-
67+
6868
@Test("End to end")
6969
func endToEnd() throws {
7070
let password = "password"
7171
let cost = 12
72-
72+
7373
let hash = try Hasher().hash(password: Array(password.utf8), cost: cost)
7474
let verifier = Verifier()
7575
#expect(try verifier.verify(password: Array(password.utf8), hash: hash))

0 commit comments

Comments
 (0)