Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 506 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 506 Bytes

lib-cipher

Simple access to hash and verify values with bcrypt

Example

    val cipher = com.mbryzek.cipher.Ciphers().latest
    val enc = cipher.hash("plaintext")
    println(
      s"Encrypted hash, base 64 encoded is: ${enc.hash}. Config rounds[${enc.rounds}], timeMs[${enc.timeToHashMs}]"
    )
    if (cipher.isValid(plaintext = "test", hash = enc.hash, salt = enc.salt)) {
      println("Plaintext matches hash")
    } else {
      println("Plaintext does not match hash")
    }