Skip to content

Commit

Permalink
Release 1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Feb 13, 2023
1 parent e86810e commit 3562b74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Straight-forward password hashing and verification using the latest algorithms.

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

## Creating a hash
Expand All @@ -26,7 +26,7 @@ val factory = Argon2PasswordFactory()
val password: String = "your-password-in-clear-text"
// password: String = "your-password-in-clear-text"
val hashed: String = factory.hash(password)
// hashed: String = "$argon2id$v=19$m=65536,t=50,p=8$7lY9GZ2HWkqQzQTKoE4ovA$NVYuL6+sWyU+c7Y9qnhlm+B5wihFVUhQ/DCbosk5Rxc"
// hashed: String = "$argon2id$v=19$m=65536,t=50,p=8$iN6tQw8H5rVu+o6yMl15+w$TBdvXYvCuyKOTBYxzrJXNBp+nkngOlWnDfggVESzpsg"
```

Now store the one-way hashed password safely in your database.
Expand All @@ -36,7 +36,7 @@ Now store the one-way hashed password safely in your database.
val attemptedPassword: String = "your-password-in-clear-text"
// attemptedPassword: String = "your-password-in-clear-text"
val hashedPassword: String = hashed // From the database
// hashedPassword: String = "$argon2id$v=19$m=65536,t=50,p=8$7lY9GZ2HWkqQzQTKoE4ovA$NVYuL6+sWyU+c7Y9qnhlm+B5wihFVUhQ/DCbosk5Rxc" // From the database
// hashedPassword: String = "$argon2id$v=19$m=65536,t=50,p=8$iN6tQw8H5rVu+o6yMl15+w$TBdvXYvCuyKOTBYxzrJXNBp+nkngOlWnDfggVESzpsg" // From the database
val valid: Boolean = factory.verify(attemptedPassword, hashedPassword)
// valid: Boolean = true
```
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / organization := "com.outr"
ThisBuild / version := "1.2.4"
ThisBuild / version := "1.2.5"

ThisBuild / scalaVersion := "2.13.10"
ThisBuild / crossScalaVersions := List("2.13.10", "3.2.2")
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/com/outr/scalapass/Bytes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.outr.scalapass

import fabric.Arr
import fabric._
import fabric.define.DefType
import fabric.rw._
import profig.Profig

Expand All @@ -21,7 +22,8 @@ object Bytes {

implicit val rw: RW[Bytes] = RW.from(
b => Arr(b.array.toVector.map(b => num(b.toLong))),
v => new Bytes(v.asVector.map(_.asByte).toArray)
v => new Bytes(v.asVector.map(_.asByte).toArray),
d = DefType.Arr(DefType.Int)
)

sealed trait Algorithm
Expand Down

0 comments on commit 3562b74

Please sign in to comment.