'Unresolved reference mindrot' when importing jbcrypt
robert-cronin opened this issue · comments
Robbie Cronin commented
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")
}
...