Skip to content

Commit

Permalink
Release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Jan 25, 2022
1 parent 4d5ceff commit f217242
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
# scalapass
[![CI](https://github.com/outr/scalapass/actions/workflows/ci.yml/badge.svg)](https://github.com/outr/scalapass/actions/workflows/ci.yml)

Straight-forward password hashing and verification using the latest algorithms

## SBT
```sbt
libraryDependencies += "com.outr" %% "scalapass" % "1.0.5"
```

## Creating a hash
```scala
import com.outr.scalapass.PasswordFactory

val password: String = "your-password-in-clear-text"
val hashed: String = PasswordFactory.hash(password)
```

Now store the one-way hashed password safely in your database.

## Verifying a hash
```scala
import com.outr.scalapass.PasswordFactory

val attemptedPassword: String = "your-password-in-clear-text"
val hashedPassword: String = ??? // From the database
val valid: Boolean = PasswordFactory.verify(attemptedPassword, hashedPassword)
```

Will return `true` if the `attemptedPassword` is the same as the one used to create the `hashedPassword`
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "scalapass"
organization := "com.outr"
version := "1.0.5-SNAPSHOT"
version := "1.0.5"

scalaVersion := "2.13.8"
crossScalaVersions := List("2.13.8", "2.12.15", "3.1.0")
Expand Down

0 comments on commit f217242

Please sign in to comment.