Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test
- {
- static final long startTime = System.nanoTime();
- public static void main(String[] args)
- {
- for (int i =12; i < 35; i++)
- {
- final long endTime;
- String hashed = BCrypt.hashpw(args[0], BCrypt.gensalt(i));
- try
- {
- compare(args[1],hashed);
- }
- finally
- {
- endTime = System.nanoTime();
- }
- final long duration = endTime - startTime;
- double time = (double)duration/1000000000.0;
- System.out.println(time +" seconds. | cost="+i);
- }
- }
- public static void compare(String compare, String hashed)
- {
- BCrypt.checkpw(compare, hashed);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement