git ssb

0+

dangerousbeans / %aPBe2k3ugtjBr4rrsU1…



Commit cbf96b56c7d0b393c51ab0fd156365cf162b642f

Merge pull request #49 from jabley/string-builder

Prefer StringBuilder to StringBuffer
Aman Gupta committed on 3/31/2013, 3:23:26 AM
Parent: d2dceb85119745ede21773347704559e35f67266
Parent: c7647f059adbb72fb8e4423655861f7e4df432bf

Files changed

ext/jruby/bcrypt_jruby/BCrypt.javachanged
ext/jruby/bcrypt_jruby/BCrypt.javaView
@@ -385,9 +385,9 @@
385385 */
386386 private static String encode_base64(byte d[], int len)
387387 throws IllegalArgumentException {
388388 int off = 0;
389- StringBuffer rs = new StringBuffer();
389+ StringBuilder rs = new StringBuilder();
390390 int c1, c2;
391391
392392 if (len <= 0 || len > d.length)
393393 throw new IllegalArgumentException ("Invalid len");
@@ -438,9 +438,9 @@
438438 * @throws IllegalArgumentException if maxolen is invalid
439439 */
440440 private static byte[] decode_base64(String s, int maxolen)
441441 throws IllegalArgumentException {
442- StringBuffer rs = new StringBuffer();
442+ StringBuilder rs = new StringBuilder();
443443 int off = 0, slen = s.length(), olen = 0;
444444 byte ret[];
445445 byte c1, c2, c3, c4, o;
446446
@@ -650,9 +650,9 @@
650650 String real_salt;
651651 byte passwordb[], saltb[], hashed[];
652652 char minor = (char)0;
653653 int rounds, off = 0;
654- StringBuffer rs = new StringBuffer();
654+ StringBuilder rs = new StringBuilder();
655655
656656 if (salt.charAt(0) != '$' || salt.charAt(1) != '2')
657657 throw new IllegalArgumentException ("Invalid salt version");
658658 if (salt.charAt(2) == '$')
@@ -703,9 +703,9 @@
703703 * @param random an instance of SecureRandom to use
704704 * @return an encoded salt value
705705 */
706706 public static String gensalt(int log_rounds, SecureRandom random) {
707- StringBuffer rs = new StringBuffer();
707+ StringBuilder rs = new StringBuilder();
708708 byte rnd[] = new byte[BCRYPT_SALT_LEN];
709709
710710 random.nextBytes(rnd);
711711

Built with git-ssb-web