|
From: <pe...@us...> - 2004-01-09 16:34:35
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto
In directory sc8-pr-cvs1:/tmp/cvs-serv28282/src/java/org/neuclear/commons/crypto
Modified Files:
CryptoTools.java
Log Message:
changed use of base36 encoding to base32 to ensure compatibility with other schemes.
Index: CryptoTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** CryptoTools.java 19 Dec 2003 00:31:16 -0000 1.9
--- CryptoTools.java 9 Jan 2004 16:34:32 -0000 1.10
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.10 2004/01/09 16:34:32 pelle
+ * changed use of base36 encoding to base32 to ensure compatibility with other schemes.
+ *
* Revision 1.9 2003/12/19 00:31:16 pelle
* Lots of usability changes through out all the passphrase agents and end user tools.
***************
*** 528,535 ****
return true;
}
!
! public static String formatAsBase36(final byte[] val) {
final BigInteger big = new BigInteger(val);
! return big.toString(36);
}
--- 531,543 ----
return true;
}
! /**
! * Unpadded Base32 Encoding as defined in:
! * <a href="http://www.waterken.com/dev/Enc/base32/">http://www.waterken.com/dev/Enc/base32/</a>
! * @param val
! * @return
! */
! public static String encodeBase32(final byte[] val) {
final BigInteger big = new BigInteger(val);
! return big.toString(32);
}
***************
*** 541,545 ****
public static String createRandomID(int length) {
final BigInteger big = new BigInteger(length, getRandomInstance());
! return big.toString(36);
}
--- 549,553 ----
public static String createRandomID(int length) {
final BigInteger big = new BigInteger(length, getRandomInstance());
! return big.toString(32);
}
|