blob: 7563e085f413d8df63a409fd71ae46b778902fae [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Fri Mar 04 17:58:55 EST 2016 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
SimpleHash (Apache Shiro 1.2.4 API)
</TITLE>
<META NAME="date" CONTENT="2016-03-04">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SimpleHash (Apache Shiro 1.2.4 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SimpleHash.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/shiro/crypto/hash/Sha512Hash.html" title="class in org.apache.shiro.crypto.hash"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHashRequest.html" title="class in org.apache.shiro.crypto.hash"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/shiro/crypto/hash/SimpleHash.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SimpleHash.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.shiro.codec.CodecSupport">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.crypto.hash</FONT>
<BR>
Class SimpleHash</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html" title="class in org.apache.shiro.codec">org.apache.shiro.codec.CodecSupport</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">org.apache.shiro.crypto.hash.AbstractHash</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.crypto.hash.SimpleHash</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</A>, <A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/shiro/crypto/hash/Md2Hash.html" title="class in org.apache.shiro.crypto.hash">Md2Hash</A>, <A HREF="../../../../../org/apache/shiro/crypto/hash/Md5Hash.html" title="class in org.apache.shiro.crypto.hash">Md5Hash</A>, <A HREF="../../../../../org/apache/shiro/crypto/hash/Sha1Hash.html" title="class in org.apache.shiro.crypto.hash">Sha1Hash</A>, <A HREF="../../../../../org/apache/shiro/crypto/hash/Sha256Hash.html" title="class in org.apache.shiro.crypto.hash">Sha256Hash</A>, <A HREF="../../../../../org/apache/shiro/crypto/hash/Sha384Hash.html" title="class in org.apache.shiro.crypto.hash">Sha384Hash</A>, <A HREF="../../../../../org/apache/shiro/crypto/hash/Sha512Hash.html" title="class in org.apache.shiro.crypto.hash">Sha512Hash</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.43"><B>SimpleHash</B></A><DT>extends <A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></DL>
</PRE>
<P>
A <code>Hash</code> implementation that allows any <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to
be used. This class is a less type-safe variant than the other <code>AbstractHash</code> subclasses
(e.g. <A HREF="../../../../../org/apache/shiro/crypto/hash/Sha512Hash.html" title="class in org.apache.shiro.crypto.hash"><CODE>Sha512Hash</CODE></A>, etc), but it does allow for any algorithm name to be specified in case the other subclass
implementations do not represent an algorithm that you may want to use.
<p/>
As of Shiro 1.1, this class effectively replaces the (now-deprecated) <A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash"><CODE>AbstractHash</CODE></A> class. It subclasses
<code>AbstractHash</code> only to retain backwards-compatibility.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#org.apache.shiro.crypto.hash.SimpleHash">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="nested_classes_inherited_from_class_org.apache.shiro.util.ByteSource"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Nested classes/interfaces inherited from interface org.apache.shiro.util.<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.Util.html" title="class in org.apache.shiro.util">ByteSource.Util</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.shiro.codec.CodecSupport"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.shiro.codec.<A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html" title="class in org.apache.shiro.codec">CodecSupport</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#PREFERRED_ENCODING">PREFERRED_ENCODING</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#SimpleHash(java.lang.String)">SimpleHash</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an new instance with only its <code>algorithmName</code> set - no hashing is performed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#SimpleHash(java.lang.String, java.lang.Object)">SimpleHash</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an <code>algorithmName</code>-specific hash of the specified <code>source</code> with no <code>salt</code> using a
single hash iteration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#SimpleHash(java.lang.String, java.lang.Object, java.lang.Object)">SimpleHash</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;salt)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an <code>algorithmName</code>-specific hash of the specified <code>source</code> using the given <code>salt</code>
using a single hash iteration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#SimpleHash(java.lang.String, java.lang.Object, java.lang.Object, int)">SimpleHash</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;salt,
int&nbsp;hashIterations)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an <code>algorithmName</code>-specific hash of the specified <code>source</code> using the given
<code>salt</code> a total of <code>hashIterations</code> times.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#convertSaltToBytes(java.lang.Object)">convertSaltToBytes</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;salt)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Acquires the specified <code>salt</code> argument's bytes and returns them in the form of a <code>ByteSource</code> instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#convertSourceToBytes(java.lang.Object)">convertSourceToBytes</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Acquires the specified <code>source</code> argument's bytes and returns them in the form of a <code>ByteSource</code> instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if the specified object is a Hash and its <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A> is identical to
this Hash's byte array, <code>false</code> otherwise.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getAlgorithmName()">getAlgorithmName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when performing the hash.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()">getBytes</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the wrapped byte array.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security">MessageDigest</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getDigest(java.lang.String)">getDigest</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the JDK MessageDigest instance to use for executing the hash.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getIterations()">getIterations</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of hash iterations used to compute the hash.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getSalt()">getSalt</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a salt used to compute the hash or <code>null</code> if no salt was used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#hash(byte[])">hash</A></B>(byte[]&nbsp;bytes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hashes the specified byte array without a salt for a single iteration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#hash(byte[], byte[])">hash</A></B>(byte[]&nbsp;bytes,
byte[]&nbsp;salt)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hashes the specified byte array using the given <code>salt</code> for a single iteration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#hash(byte[], byte[], int)">hash</A></B>(byte[]&nbsp;bytes,
byte[]&nbsp;salt,
int&nbsp;hashIterations)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hashes the specified byte array using the given <code>salt</code> for the specified number of iterations.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#hashCode()">hashCode</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simply returns toHex().hashCode();</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#isEmpty()">isEmpty</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if the underlying wrapped byte array is null or empty (zero length), <code>false</code>
otherwise.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#setBytes(byte[])">setBytes</A></B>(byte[]&nbsp;alreadyHashedBytes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the raw bytes stored by this hash instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#setIterations(int)">setIterations</A></B>(int&nbsp;iterations)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the iterations used to previously compute AN ALREADY GENERATED HASH.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#setSalt(org.apache.shiro.util.ByteSource)">setSalt</A></B>(<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A>&nbsp;salt)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the salt used to previously compute AN ALREADY GENERATED HASH.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toBase64()">toBase64</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a Base64-encoded string of the underlying <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toByteSource(java.lang.Object)">toByteSource</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts a given object into a <code>ByteSource</code> instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toHex()">toHex</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a hex-encoded string of the underlying <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toString()">toString</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simple implementation that merely returns <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toHex()"><CODE>toHex()</CODE></A>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.shiro.codec.CodecSupport"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.shiro.codec.<A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html" title="class in org.apache.shiro.codec">CodecSupport</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#isByteSource(java.lang.Object)">isByteSource</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#objectToBytes(java.lang.Object)">objectToBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#objectToString(java.lang.Object)">objectToString</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(char[])">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(char[], java.lang.String)">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(java.io.File)">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(java.io.InputStream)">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(java.lang.Object)">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(java.lang.String)">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(java.lang.String, java.lang.String)">toBytes</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toChars(byte[])">toChars</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toChars(byte[], java.lang.String)">toChars</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toString(byte[])">toString</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toString(byte[], java.lang.String)">toString</A>, <A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toString(java.lang.Object)">toString</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SimpleHash(java.lang.String)"><!-- --></A><H3>
SimpleHash</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.92"><B>SimpleHash</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName)</PRE>
<DL>
<DD>Creates an new instance with only its <code>algorithmName</code> set - no hashing is performed.
<p/>
Because all other constructors in this class hash the <code>source</code> constructor argument, this
constructor is useful in scenarios when you have a byte array that you know is already hashed and
just want to set the bytes in their raw form directly on an instance. After using this constructor,
you can then immediately call <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#setBytes(byte[])"><CODE>setBytes</CODE></A> to have a fully-initialized instance.
<p/>
<b>N.B.</b>The algorithm identified by the <code>algorithmName</code> parameter must be available on the JVM. If it
is not, a <A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto"><CODE>UnknownAlgorithmException</CODE></A> will be thrown when the hash is performed (not at instantiation).
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>algorithmName</CODE> - the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when
performing the hash.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto"><CODE>UnknownAlgorithmException</CODE></A></DL>
</DL>
<HR>
<A NAME="SimpleHash(java.lang.String, java.lang.Object)"><!-- --></A><H3>
SimpleHash</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.115"><B>SimpleHash</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source)
throws <A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec">CodecException</A>,
<A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Creates an <code>algorithmName</code>-specific hash of the specified <code>source</code> with no <code>salt</code> using a
single hash iteration.
<p/>
This is a convenience constructor that merely executes <code>this( algorithmName, source, null, 1);</code>.
<p/>
Please see the
<A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#SimpleHash(java.lang.String, java.lang.Object, java.lang.Object, int)"><CODE>SimpleHashHash(algorithmName, Object,Object,int)</CODE></A>
constructor for the types of Objects that may be passed into this constructor, as well as how to support further
types.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>algorithmName</CODE> - the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when
performing the hash.<DD><CODE>source</CODE> - the object to be hashed.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec">CodecException</A></CODE> - if the specified <code>source</code> cannot be converted into a byte array (byte[]).
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the <code>algorithmName</code> is not available.</DL>
</DL>
<HR>
<A NAME="SimpleHash(java.lang.String, java.lang.Object, java.lang.Object)"><!-- --></A><H3>
SimpleHash</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.138"><B>SimpleHash</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;salt)
throws <A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec">CodecException</A>,
<A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Creates an <code>algorithmName</code>-specific hash of the specified <code>source</code> using the given <code>salt</code>
using a single hash iteration.
<p/>
It is a convenience constructor that merely executes <code>this( algorithmName, source, salt, 1);</code>.
<p/>
Please see the
<A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#SimpleHash(java.lang.String, java.lang.Object, java.lang.Object, int)"><CODE>SimpleHashHash(algorithmName, Object,Object,int)</CODE></A>
constructor for the types of Objects that may be passed into this constructor, as well as how to support further
types.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>algorithmName</CODE> - the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when
performing the hash.<DD><CODE>source</CODE> - the source object to be hashed.<DD><CODE>salt</CODE> - the salt to use for the hash
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec">CodecException</A></CODE> - if either constructor argument cannot be converted into a byte array.
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the <code>algorithmName</code> is not available.</DL>
</DL>
<HR>
<A NAME="SimpleHash(java.lang.String, java.lang.Object, java.lang.Object, int)"><!-- --></A><H3>
SimpleHash</H3>
<PRE>
public <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.165"><B>SimpleHash</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;salt,
int&nbsp;hashIterations)
throws <A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec">CodecException</A>,
<A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Creates an <code>algorithmName</code>-specific hash of the specified <code>source</code> using the given
<code>salt</code> a total of <code>hashIterations</code> times.
<p/>
By default, this class only supports Object method arguments of
type <code>byte[]</code>, <code>char[]</code>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><CODE>File</CODE></A>,
<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><CODE>InputStream</CODE></A> or <A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util"><CODE>ByteSource</CODE></A>. If either
argument is anything other than these types a <A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec"><CODE>CodecException</CODE></A>
will be thrown.
<p/>
If you want to be able to hash other object types, or use other salt types, you need to override the
<A HREF="../../../../../org/apache/shiro/codec/CodecSupport.html#toBytes(java.lang.Object)"><CODE>toBytes(Object)</CODE></A> method to support those specific types. Your other option is to
convert your arguments to one of the default supported types first before passing them in to this
constructor}.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>algorithmName</CODE> - the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when
performing the hash.<DD><CODE>source</CODE> - the source object to be hashed.<DD><CODE>salt</CODE> - the salt to use for the hash<DD><CODE>hashIterations</CODE> - the number of times the <code>source</code> argument hashed for attack resiliency.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/codec/CodecException.html" title="class in org.apache.shiro.codec">CodecException</A></CODE> - if either Object constructor argument cannot be converted into a byte array.
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the <code>algorithmName</code> is not available.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="convertSourceToBytes(java.lang.Object)"><!-- --></A><H3>
convertSourceToBytes</H3>
<PRE>
protected <A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.191"><B>convertSourceToBytes</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;source)</PRE>
<DL>
<DD>Acquires the specified <code>source</code> argument's bytes and returns them in the form of a <code>ByteSource</code> instance.
<p/>
This implementation merely delegates to the convenience <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toByteSource(java.lang.Object)"><CODE>toByteSource(Object)</CODE></A> method for generic
conversion. Can be overridden by subclasses for source-specific conversion.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>source</CODE> - the source object to be hashed.
<DT><B>Returns:</B><DD>the source's bytes in the form of a <code>ByteSource</code> instance.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="convertSaltToBytes(java.lang.Object)"><!-- --></A><H3>
convertSaltToBytes</H3>
<PRE>
protected <A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.205"><B>convertSaltToBytes</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;salt)</PRE>
<DL>
<DD>Acquires the specified <code>salt</code> argument's bytes and returns them in the form of a <code>ByteSource</code> instance.
<p/>
This implementation merely delegates to the convenience <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toByteSource(java.lang.Object)"><CODE>toByteSource(Object)</CODE></A> method for generic
conversion. Can be overridden by subclasses for salt-specific conversion.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>salt</CODE> - the salt to be use for the hash.
<DT><B>Returns:</B><DD>the salt's bytes in the form of a <code>ByteSource</code> instance.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="toByteSource(java.lang.Object)"><!-- --></A><H3>
toByteSource</H3>
<PRE>
protected <A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.216"><B>toByteSource</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</PRE>
<DL>
<DD>Converts a given object into a <code>ByteSource</code> instance. Assumes the object can be converted to bytes.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>o</CODE> - the Object to convert into a <code>ByteSource</code> instance.
<DT><B>Returns:</B><DD>the <code>ByteSource</code> representation of the specified object's bytes.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getAlgorithmName()"><!-- --></A><H3>
getAlgorithmName</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.238"><B>getAlgorithmName</B></A>()</PRE>
<DL>
<DD>Returns the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when performing the hash.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/Hash.html#getAlgorithmName()">getAlgorithmName</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/Hash.html" title="interface in org.apache.shiro.crypto.hash">Hash</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#getAlgorithmName()">getAlgorithmName</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security"><CODE>MessageDigest</CODE></A> algorithm name to use when performing the hash.</DL>
</DD>
</DL>
<HR>
<A NAME="getSalt()"><!-- --></A><H3>
getSalt</H3>
<PRE>
public <A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.242"><B>getSalt</B></A>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/Hash.html#getSalt()">Hash</A></CODE></B></DD>
<DD>Returns a salt used to compute the hash or <code>null</code> if no salt was used.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a salt used to compute the hash or <code>null</code> if no salt was used.</DL>
</DD>
</DL>
<HR>
<A NAME="getIterations()"><!-- --></A><H3>
getIterations</H3>
<PRE>
public int <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.246"><B>getIterations</B></A>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/Hash.html#getIterations()">Hash</A></CODE></B></DD>
<DD>Returns the number of hash iterations used to compute the hash.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the number of hash iterations used to compute the hash.</DL>
</DD>
</DL>
<HR>
<A NAME="getBytes()"><!-- --></A><H3>
getBytes</H3>
<PRE>
public byte[] <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.250"><B>getBytes</B></A>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html#getBytes()">ByteSource</A></CODE></B></DD>
<DD>Returns the wrapped byte array.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html#getBytes()">getBytes</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#getBytes()">getBytes</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the wrapped byte array.</DL>
</DD>
</DL>
<HR>
<A NAME="setBytes(byte[])"><!-- --></A><H3>
setBytes</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.262"><B>setBytes</B></A>(byte[]&nbsp;alreadyHashedBytes)</PRE>
<DL>
<DD>Sets the raw bytes stored by this hash instance.
<p/>
The bytes are kept in raw form - they will not be hashed/changed. This is primarily a utility method for
constructing a Hash instance when the hashed value is already known.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#setBytes(byte[])">setBytes</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>alreadyHashedBytes</CODE> - the raw already-hashed bytes to store in this instance.</DL>
</DD>
</DL>
<HR>
<A NAME="setIterations(int)"><!-- --></A><H3>
setIterations</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.277"><B>setIterations</B></A>(int&nbsp;iterations)</PRE>
<DL>
<DD>Sets the iterations used to previously compute AN ALREADY GENERATED HASH.
<p/>
This is provided <em>ONLY</em> to reconstitute an already-created Hash instance. It should ONLY ever be
invoked when re-constructing a hash instance from an already-hashed value.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>iterations</CODE> - the number of hash iterations used to previously create the hash/digest.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setSalt(org.apache.shiro.util.ByteSource)"><!-- --></A><H3>
setSalt</H3>
<PRE>
public void <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.290"><B>setSalt</B></A>(<A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A>&nbsp;salt)</PRE>
<DL>
<DD>Sets the salt used to previously compute AN ALREADY GENERATED HASH.
<p/>
This is provided <em>ONLY</em> to reconstitute a Hash instance that has already been computed. It should ONLY
ever be invoked when re-constructing a hash instance from an already-hashed value.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>salt</CODE> - the salt used to previously create the hash/digest.<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDigest(java.lang.String)"><!-- --></A><H3>
getDigest</H3>
<PRE>
protected <A HREF="http://java.sun.com/javase/6/docs/api/java/security/MessageDigest.html?is-external=true" title="class or interface in java.security">MessageDigest</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.301"><B>getDigest</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithmName)
throws <A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Returns the JDK MessageDigest instance to use for executing the hash.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#getDigest(java.lang.String)">getDigest</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>algorithmName</CODE> - the algorithm to use for the hash, provided by subclasses.
<DT><B>Returns:</B><DD>the MessageDigest object for the specified <code>algorithm</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the specified algorithm name is not available.</DL>
</DD>
</DL>
<HR>
<A NAME="hash(byte[])"><!-- --></A><H3>
hash</H3>
<PRE>
protected byte[] <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.317"><B>hash</B></A>(byte[]&nbsp;bytes)
throws <A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Hashes the specified byte array without a salt for a single iteration.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#hash(byte[])">hash</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - the bytes to hash.
<DT><B>Returns:</B><DD>the hashed bytes.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the configured <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getAlgorithmName()"><CODE>algorithmName</CODE></A> is not available.</DL>
</DD>
</DL>
<HR>
<A NAME="hash(byte[], byte[])"><!-- --></A><H3>
hash</H3>
<PRE>
protected byte[] <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.329"><B>hash</B></A>(byte[]&nbsp;bytes,
byte[]&nbsp;salt)
throws <A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Hashes the specified byte array using the given <code>salt</code> for a single iteration.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#hash(byte[], byte[])">hash</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - the bytes to hash<DD><CODE>salt</CODE> - the salt to use for the initial hash
<DT><B>Returns:</B><DD>the hashed bytes
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the configured <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getAlgorithmName()"><CODE>algorithmName</CODE></A> is not available.</DL>
</DD>
</DL>
<HR>
<A NAME="hash(byte[], byte[], int)"><!-- --></A><H3>
hash</H3>
<PRE>
protected byte[] <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.342"><B>hash</B></A>(byte[]&nbsp;bytes,
byte[]&nbsp;salt,
int&nbsp;hashIterations)
throws <A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></PRE>
<DL>
<DD>Hashes the specified byte array using the given <code>salt</code> for the specified number of iterations.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#hash(byte[], byte[], int)">hash</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - the bytes to hash<DD><CODE>salt</CODE> - the salt to use for the initial hash<DD><CODE>hashIterations</CODE> - the number of times the the <code>bytes</code> will be hashed (for attack resiliency).
<DT><B>Returns:</B><DD>the hashed bytes.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/UnknownAlgorithmException.html" title="class in org.apache.shiro.crypto">UnknownAlgorithmException</A></CODE> - if the <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getAlgorithmName()"><CODE>algorithmName</CODE></A> is not available.</DL>
</DD>
</DL>
<HR>
<A NAME="isEmpty()"><!-- --></A><H3>
isEmpty</H3>
<PRE>
public boolean <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.358"><B>isEmpty</B></A>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html#isEmpty()">ByteSource</A></CODE></B></DD>
<DD>Returns <code>true</code> if the underlying wrapped byte array is null or empty (zero length), <code>false</code>
otherwise.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the underlying wrapped byte array is null or empty (zero length), <code>false</code>
otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="toHex()"><!-- --></A><H3>
toHex</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.371"><B>toHex</B></A>()</PRE>
<DL>
<DD>Returns a hex-encoded string of the underlying <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A>.
<p/>
This implementation caches the resulting hex string so multiple calls to this method remain efficient.
However, calling <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#setBytes(byte[])"><CODE>setBytes</CODE></A> will null the cached value, forcing it to be recalculated the
next time this method is called.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html#toHex()">toHex</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#toHex()">toHex</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a hex-encoded string of the underlying <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A>.</DL>
</DD>
</DL>
<HR>
<A NAME="toBase64()"><!-- --></A><H3>
toBase64</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.387"><B>toBase64</B></A>()</PRE>
<DL>
<DD>Returns a Base64-encoded string of the underlying <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A>.
<p/>
This implementation caches the resulting Base64 string so multiple calls to this method remain efficient.
However, calling <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#setBytes(byte[])"><CODE>setBytes</CODE></A> will null the cached value, forcing it to be recalculated the
next time this method is called.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html#toBase64()">toBase64</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/shiro/util/ByteSource.html" title="interface in org.apache.shiro.util">ByteSource</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#toBase64()">toBase64</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a Base64-encoded string of the underlying <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A>.</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.400"><B>toString</B></A>()</PRE>
<DL>
<DD>Simple implementation that merely returns <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toHex()"><CODE>toHex()</CODE></A>.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#toHex()"><CODE>toHex()</CODE></A> value.</DL>
</DD>
</DL>
<HR>
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.412"><B>equals</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</PRE>
<DL>
<DD>Returns <code>true</code> if the specified object is a Hash and its <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A> is identical to
this Hash's byte array, <code>false</code> otherwise.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>o</CODE> - the object (Hash) to check for equality.
<DT><B>Returns:</B><DD><code>true</code> if the specified object is a Hash and its <A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHash.html#getBytes()"><CODE>byte array</CODE></A> is identical to
this Hash's byte array, <code>false</code> otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <A HREF="../../../../../src-html/org/apache/shiro/crypto/hash/SimpleHash.html#line.425"><B>hashCode</B></A>()</PRE>
<DL>
<DD>Simply returns toHex().hashCode();
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../../../../org/apache/shiro/crypto/hash/AbstractHash.html" title="class in org.apache.shiro.crypto.hash">AbstractHash</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>toHex().hashCode()</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SimpleHash.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/shiro/crypto/hash/Sha512Hash.html" title="class in org.apache.shiro.crypto.hash"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/shiro/crypto/hash/SimpleHashRequest.html" title="class in org.apache.shiro.crypto.hash"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/shiro/crypto/hash/SimpleHash.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SimpleHash.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.shiro.codec.CodecSupport">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>