Skip to content

Commit a573e64

Browse files
committed
Add README
1 parent d62aa93 commit a573e64

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Swift Bcrypt
2+
3+
A native, dependency and Foundation free Swift implementation of the bcrypt password hashing algorithm, based on the [OpenBSD implementation](https://github.com/openbsd/src/blob/master/lib/libc/crypt/bcrypt.c).
4+
5+
> [!WARNING]
6+
> This package is not yet ready for production use. It is still in development and has not been thoroughly tested.
7+
8+
## Installation
9+
10+
```swift
11+
.package(url: "https://github.com/ptoffy/swift-bcrypt.git", branch: "main")
12+
```
13+
14+
```swift
15+
.product(name: "Bcrypt", package: "bcrypt")
16+
```
17+
18+
## Usage
19+
20+
```swift
21+
import Bcrypt
22+
23+
let password = "password"
24+
let hash = try Hasher(version: .v2a).hash(password: password)
25+
```
26+

Sources/Bcrypt/EksBlowfish.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
///
33
/// This work is based on
44
/// 1. Applied Cryptography, Second Edition by Bruce Schneier, section 14 and the corresponding code in Part V.
5-
/// 2. The OpenBSD implementation of bcrypt at https://github.com/openbsd/src/blob/master/lib/libc/crypt/bcrypt.c.
5+
/// 2. The OpenBSD implementation of bcrypt at https://github.com/openbsd/src/blob/master/lib/libc/crypt/bcrypt.c.
66
/// The function names and variable names are kept the same as in the OpenBSD implementation.
77
@usableFromInline enum EksBlowfish {
88
@usableFromInline static let N = 16 // Cipher Rounds

0 commit comments

Comments
 (0)