-
-
Save iarenaza/d7e22484f825f188e4fc393918a1ae7e to your computer and use it in GitHub Desktop.
Minimal example of interop repro for a babashka script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns bb-repro.core | |
(:import (at.favre.lib.crypto.bcrypt BCrypt | |
BCrypt$Version))) | |
(defn pwhash-bcrypt | |
[password {:keys [iterations] | |
:or {iterations 12}}] | |
(let [hasher (BCrypt/with BCrypt$Version/VERSION_2Y)] | |
(.hashToString hasher iterations (.toCharArray password)))) | |
(comment | |
(pwhash-bcrypt "123" {}) | |
;; => "$2y$12$Bx7kvYuFlPF5E50aVHVSzeDykOu2pnuSoWMUKul5fSAf7PAzEqoVq" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:deps | |
{at.favre.lib/bcrypt {:mvn/version "0.10.2"}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment