You can import external Ivy dependencies during you ammonite session. First, you have to import the Ivy (SBT) dependency (The example imports the jBCrypt library from the Maven repository). Additional information can be found at https://github.com/svenkubiak/jBCrypt.

import $ivy.`de.svenkubiak::jBCrypt:0.4.1`

The required dependencies are downloaded during the session. Second, you have to import the BCrypt dependency that should be used.

import org.mindrot.jbcrypt.BCrypt

And use it:

BCrypt.hashpw("Foo-Bar-Password",BCrypt.gensalt())

Leave a Reply