Class BCryptHelper


  • public final class BCryptHelper
    extends Object
    Utility methods for using BCrypt.
    • Method Detail

      • getIterations

        public static int getIterations​(String bcryptedPassword)
        Gets the number of iterations used in a BCrypt hash.
        Parameters:
        bcryptedPassword - The hash to extract the iterations from.
        Returns:
        The number of iterations.
        Throws:
        IllegalArgumentException - if the hash is not a valid BCrypt hash or uses another version than 2a.