You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lh...@apache.org on 2009/06/16 19:04:51 UTC
svn commit: r785297 -
/incubator/shiro/trunk/core/src/main/java/org/apache/ki/crypto/hash/AbstractHash.java
Author: lhazlewood
Date: Tue Jun 16 17:04:51 2009
New Revision: 785297
URL: http://svn.apache.org/viewvc?rev=785297&view=rev
Log:
ensured the cached hex and base64 encoded values are marked as transient to prevent double payload size when remoting. Also implemented Serializable to allow easy transfer over the wire
Modified:
incubator/shiro/trunk/core/src/main/java/org/apache/ki/crypto/hash/AbstractHash.java
Modified: incubator/shiro/trunk/core/src/main/java/org/apache/ki/crypto/hash/AbstractHash.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/ki/crypto/hash/AbstractHash.java?rev=785297&r1=785296&r2=785297&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/ki/crypto/hash/AbstractHash.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/ki/crypto/hash/AbstractHash.java Tue Jun 16 17:04:51 2009
@@ -21,6 +21,7 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
+import java.io.Serializable;
import org.apache.ki.codec.Base64;
import org.apache.ki.codec.CodecException;
@@ -40,15 +41,15 @@
* @author Les Hazlewood
* @since 0.9
*/
-public abstract class AbstractHash extends CodecSupport implements Hash {
+public abstract class AbstractHash extends CodecSupport implements Hash, Serializable {
/** The hashed data */
private byte[] bytes = null;
/** Cached value of the {@link #toHex() toHex()} call so multiple calls won't incur repeated overhead. */
- private String hexEncoded = null;
+ private transient String hexEncoded = null;
/** Cached value of the {@link #toBase64() toBase64()} call so multiple calls won't incur repeated overhead. */
- private String base64Encoded = null;
+ private transient String base64Encoded = null;
/**
* Creates an new instance without any of its properties set (no hashing is performed).