jBCrypt icon indicating copy to clipboard operation
jBCrypt copied to clipboard

'Unresolved reference mindrot' when importing jbcrypt

Open robert-cronin opened this issue 6 years ago • 0 comments

Gradle file looks like this:

dependencies {
    compile group: 'org.mindrot', name: 'jbcrypt', version: '0.4'
    ...
}

Kotlin file where import error occurs looks like this:

...
import org.mindrot.jbcrypt.BCrypt
...

fun ...() {
            // Hash a password for the first time
            val hashed = BCrypt.hashpw(password, BCrypt.gensalt())

            // gensalt's log_rounds parameter determines the complexity
            // the work factor is 2**log_rounds, and the default is 10
            val hashed = BCrypt.hashpw(password, BCrypt.gensalt(12))

            // Check that an unencrypted password matches one that has
            // previously been hashed
            if (BCrypt.checkpw(candidate, hashed))
                System.out.println("It matches")
            else
                System.out.println("It does not match")
}
...

robert-cronin avatar Mar 09 '19 05:03 robert-cronin