⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sha1.html

📁 实现了SHA1加密算法,只需要sha1.js和SHA1.java 开发环境:JDK1.5
💻 HTML
📖 第 1 页 / 共 3 页
字号:
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#doTest()">doTest</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Just a test function to output the results of the 6 working funcions to the standard out.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#hex_hmac_sha1(java.lang.String, java.lang.String)">hex_hmac_sha1</A></B>(java.lang.String&nbsp;key,              java.lang.String&nbsp;data)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is one of the functions you'll usually want to call It take a string arguments and returns either hex or base-64 encoded strings Creation date: (3/27/2004 6:05:10 PM)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#hex_sha1(java.lang.String)">hex_sha1</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is one of the functions you'll usually want to call It take a string argument and returns either hex or base-64 encoded strings Creation date: (3/27/2004 6:05:10 PM)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#rol(int, int)">rol</A></B>(int&nbsp;num,    int&nbsp;cnt)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bitwise rotate a 32-bit number to the left.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#safe_add(int, int)">safe_add</A></B>(int&nbsp;x,         int&nbsp;y)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add ints, wrapping at 2^32.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#sha1_ft(int, int, int, int)">sha1_ft</A></B>(int&nbsp;t,        int&nbsp;b,        int&nbsp;c,        int&nbsp;d)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perform the appropriate triplet combination function for the current Creation date: (3/26/2004 1:05:01 PM)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#sha1_kt(int)">sha1_kt</A></B>(int&nbsp;t)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determine the appropriate additive constant for the current iteration Creation date: (3/26/2004 1:05:01 PM)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#sha1_vm_test()">sha1_vm_test</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is a boolean returnig test function that exists in the sha1.js library.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#str_hmac_sha1(java.lang.String, java.lang.String)">str_hmac_sha1</A></B>(java.lang.String&nbsp;key,              java.lang.String&nbsp;data)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is one of the functions you'll usually want to call It take a string arguments and returns either hex or base-64 encoded strings Creation date: (3/26/2004 1:05:01 PM)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#str_sha1(java.lang.String)">str_sha1</A></B>(java.lang.String&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is one of the functions you'll usually want to call It take a string argument and returns either hex or base-64 encoded strings Creation date: (3/26/2004 1:05:01 PM)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#str2binb(java.lang.String)">str2binb</A></B>(java.lang.String&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert an 8-bit or 16-bit string to an array of big-endian words In 8-bit function, characters >255 have their hi-byte silently ignored.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static&nbsp;int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="SHA1.html#strechBinArray(int[], int)">strechBinArray</A></B>(int[]&nbsp;oldbin,               int&nbsp;size)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;increase an int array to a desired sized + 1 while keeping the old values.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><clinit>, 
clone, 
equals, 
finalize, 
getClass, 
hashCode, 
notify, 
notifyAll, 
registerNatives, 
toString, 
wait, 
wait, 
wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="hexcase"><!-- --></A><H3>
hexcase</H3>
<PRE>
private static final boolean <B>hexcase</B></PRE>
<DL>
</DL>
<HR>

<A NAME="b64pad"><!-- --></A><H3>
b64pad</H3>
<PRE>
private static final java.lang.String <B>b64pad</B></PRE>
<DL>
</DL>
<HR>

<A NAME="chrsz"><!-- --></A><H3>
chrsz</H3>
<PRE>
private static final int <B>chrsz</B></PRE>
<DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="SHA1()"><!-- --></A><H3>
SHA1</H3>
<PRE>
public <B>SHA1</B>()</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="b64_hmac_sha1(java.lang.String, java.lang.String)"><!-- --></A><H3>
b64_hmac_sha1</H3>
<PRE>
public static java.lang.String <B>b64_hmac_sha1</B>(java.lang.String&nbsp;key,                                             java.lang.String&nbsp;data)</PRE>
<DL>
<DD>This is one of the functions you'll usually want to call It take a string arguments and returns either hex or base-64 encoded strings Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - java.lang.String<DD><CODE>data</CODE> - java.lang.String<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>

<A NAME="b64_sha1(java.lang.String)"><!-- --></A><H3>
b64_sha1</H3>
<PRE>
public static java.lang.String <B>b64_sha1</B>(java.lang.String&nbsp;s)</PRE>
<DL>
<DD>This is one of the functions you'll usually want to call It take a string argument and returns either hex or base-64 encoded strings Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - java.lang.String<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>

<A NAME="binb2b64(int[])"><!-- --></A><H3>
binb2b64</H3>
<PRE>
private static java.lang.String <B>binb2b64</B>(int[]&nbsp;binarray)</PRE>
<DL>
<DD>Convert an array of big-endian words to a base-64 string Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>binarray</CODE> - int[]<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>

<A NAME="binb2hex(int[])"><!-- --></A><H3>
binb2hex</H3>
<PRE>
private static java.lang.String <B>binb2hex</B>(int[]&nbsp;binarray)</PRE>
<DL>
<DD>Convert an array of big-endian words to a hex string. Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>binarray</CODE> - int[]<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>

<A NAME="binb2str(int[])"><!-- --></A><H3>
binb2str</H3>
<PRE>
private static java.lang.String <B>binb2str</B>(int[]&nbsp;bin)</PRE>
<DL>
<DD>Convert an array of big-endian words to a string Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>bin</CODE> - int[]<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>

<A NAME="bit_rol(int, int)"><!-- --></A><H3>
bit_rol</H3>
<PRE>
private static int <B>bit_rol</B>(int&nbsp;num,                           int&nbsp;cnt)</PRE>
<DL>
<DD>Bitwise rotate a 32-bit number to the left. Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>num</CODE> - int<DD><CODE>cnt</CODE> - int<DT><B>Returns:</B><DD>int</DL>
</DD>
</DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -