Calling:
(compare nil (encrypt "hello"))
returns false as expected. However, calling
raises a NullPointerException from org.mindrot.jbcrypt.BCrypt.hashpw. It would be better to validate both parameters before passing them down to BCrypt/checkpw, and return false if one of them is nil.