diff --git a/src/main/java/org/mindrot/BCrypt.java b/src/main/java/org/mindrot/BCrypt.java index 188193f..2427771 100644 --- a/src/main/java/org/mindrot/BCrypt.java +++ b/src/main/java/org/mindrot/BCrypt.java @@ -388,7 +388,7 @@ public class BCrypt { private static String encode_base64(byte d[], int len) throws IllegalArgumentException { int off = 0; - StringBuffer rs = new StringBuffer(); + StringBuilder rs = new StringBuilder(); int c1, c2; if (len <= 0 || len > d.length) @@ -441,7 +441,7 @@ private static byte char64(char x) { */ private static byte[] decode_base64(String s, int maxolen) throws IllegalArgumentException { - StringBuffer rs = new StringBuffer(); + StringBuilder rs = new StringBuilder(); int off = 0, slen = s.length(), olen = 0; byte ret[]; byte c1, c2, c3, c4, o; @@ -654,7 +654,7 @@ public static String hashpw(String password, String salt) { byte passwordb[], saltb[], hashed[]; char minor = (char)0; int rounds, off = 0; - StringBuffer rs = new StringBuffer(); + StringBuilder rs = new StringBuilder(); if (salt.charAt(0) != '$' || salt.charAt(1) != '2') throw new IllegalArgumentException ("Invalid salt version"); @@ -712,7 +712,7 @@ public static String hashpw(String password, String salt) { * @return an encoded salt value */ public static String gensalt(int log_rounds, SecureRandom random) { - StringBuffer rs = new StringBuffer(); + StringBuilder rs = new StringBuilder(); byte rnd[] = new byte[BCRYPT_SALT_LEN]; random.nextBytes(rnd);