From 3562b74b8fd0b722e621849eced49babc170012c Mon Sep 17 00:00:00 2001 From: Matt Hicks Date: Mon, 13 Feb 2023 12:26:09 -0600 Subject: [PATCH] Release 1.2.5 --- README.md | 6 +++--- build.sbt | 2 +- src/main/scala/com/outr/scalapass/Bytes.scala | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 06e86fe..a566ee9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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 ``` diff --git a/build.sbt b/build.sbt index 1161a97..66be5dc 100644 --- a/build.sbt +++ b/build.sbt @@ -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") diff --git a/src/main/scala/com/outr/scalapass/Bytes.scala b/src/main/scala/com/outr/scalapass/Bytes.scala index ef94b62..0acdbfb 100644 --- a/src/main/scala/com/outr/scalapass/Bytes.scala +++ b/src/main/scala/com/outr/scalapass/Bytes.scala @@ -2,6 +2,7 @@ package com.outr.scalapass import fabric.Arr import fabric._ +import fabric.define.DefType import fabric.rw._ import profig.Profig @@ -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