import Argon2Kit
let password = "password"
let salt = Data.random(bytes: 16)
let digest = try! Argon2.hash(password: password, salt: salt)
let rawData = digest.rawData // 32 bytes of the hash
let encodedData = digest.encodedData // the Argon2 encoded data
let encodedString = digest.encodedString // the Argon2 encoded string
let isVerified = try! Argon2.verify(password: password, encodedHash: encodedString)
Features and bugs
Please file feature requests and bugs at the issue tracker.
Argon2Kit
Swift wrapper for the C implementation of Argon2, the winner of the Password Hash Competition.
Installation (SPM)
Argon2Swift can be installed via SPM (Swift Package Manger) by adding the following to your depencencies:
Usage
High-level hashing and verification:
Features and bugs
Please file feature requests and bugs at the issue tracker.
Licensing