📄 sha1.html
字号:
<HR>
<A NAME="cleanB64Str(java.lang.String)"><!-- --></A><H3>
cleanB64Str</H3>
<PRE>
private static java.lang.String <B>cleanB64Str</B>(java.lang.String str)</PRE>
<DL>
<DD>Cleans a base64 String from all the trailing 'A' or other characters put there by binb2b64 that made the bin array 4 times larger than it originally was. Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - java.lang.String<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>
<A NAME="complete216(int[])"><!-- --></A><H3>
complete216</H3>
<PRE>
private static int[] <B>complete216</B>(int[] oldbin)</PRE>
<DL>
<DD>Makes an int array of a length less than 16 an array of length 16 with all previous cells at their previous indexes. Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - java.lang.String<DT><B>Returns:</B><DD>int[]</DL>
</DD>
</DL>
<HR>
<A NAME="concat(int[], int[])"><!-- --></A><H3>
concat</H3>
<PRE>
private static int[] <B>concat</B>(int[] oldbin, int[] newbin)</PRE>
<DL>
<DD>Joins two int arrays and return one that contains all the previous values. This corresponds to the concat method of the JavaScript Array object. Creation date: (3/27/2004 6:05:10 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - java.lang.String<DT><B>Returns:</B><DD>int[]</DL>
</DD>
</DL>
<HR>
<A NAME="core_hmac_sha1(java.lang.String, java.lang.String)"><!-- --></A><H3>
core_hmac_sha1</H3>
<PRE>
private static int[] <B>core_hmac_sha1</B>(java.lang.String key, java.lang.String data)</PRE>
<DL>
<DD>Calculate the HMAC-SHA1 of a key and some data Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - java.lang.String[]<DD><CODE>len</CODE> - int<DT><B>Returns:</B><DD>int</DL>
</DD>
</DL>
<HR>
<A NAME="core_sha1(int[], int)"><!-- --></A><H3>
core_sha1</H3>
<PRE>
private static int[] <B>core_sha1</B>(int[] x, int len)</PRE>
<DL>
<DD>Calculate the SHA-1 of an array of big-endian words, and a bit length Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - java.lang.String[]<DD><CODE>len</CODE> - int<DT><B>Returns:</B><DD>int</DL>
</DD>
</DL>
<HR>
<A NAME="doTest()"><!-- --></A><H3>
doTest</H3>
<PRE>
private static void <B>doTest</B>()</PRE>
<DL>
<DD>Just a test function to output the results of the 6 working funcions to the standard out. The two Strings used as parameters are null. Feel free to test with different values. Creation date:(3/27/20046:05:10PM)<DD><DL>
<DT><B>Returns:</B><DD>java.lang.String</DL>
</DD>
</DL>
<HR>
<A NAME="hex_hmac_sha1(java.lang.String, java.lang.String)"><!-- --></A><H3>
hex_hmac_sha1</H3>
<PRE>
public static java.lang.String <B>hex_hmac_sha1</B>(java.lang.String key, java.lang.String 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="hex_sha1(java.lang.String)"><!-- --></A><H3>
hex_sha1</H3>
<PRE>
public static java.lang.String <B>hex_sha1</B>(java.lang.String 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="rol(int, int)"><!-- --></A><H3>
rol</H3>
<PRE>
private static int <B>rol</B>(int num, int cnt)</PRE>
<DL>
<DD>Bitwise rotate a 32-bit number to the left. * Creation date: (3/26/2004 1:05:01 PM) Creation date: (3/27/2004 6:05:10 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>
<HR>
<A NAME="safe_add(int, int)"><!-- --></A><H3>
safe_add</H3>
<PRE>
private static int <B>safe_add</B>(int x, int y)</PRE>
<DL>
<DD>Add ints, wrapping at 2^32. This uses 16-bit operations internally to work around bugs in some JS interpreters. The original function is part of the sha1.js library. It's here for compatibility. 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>
<HR>
<A NAME="sha1_ft(int, int, int, int)"><!-- --></A><H3>
sha1_ft</H3>
<PRE>
private static int <B>sha1_ft</B>(int t, int b, int c, int d)</PRE>
<DL>
<DD>Perform the appropriate triplet combination function for the current Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>t</CODE> - int<DD><CODE>b</CODE> - int<DD><CODE>c</CODE> - int<DD><CODE>d</CODE> - int<DT><B>Returns:</B><DD>int</DL>
</DD>
</DL>
<HR>
<A NAME="sha1_kt(int)"><!-- --></A><H3>
sha1_kt</H3>
<PRE>
private static int <B>sha1_kt</B>(int t)</PRE>
<DL>
<DD>Determine the appropriate additive constant for the current iteration Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>t</CODE> - int<DT><B>Returns:</B><DD>int</DL>
</DD>
</DL>
<HR>
<A NAME="sha1_vm_test()"><!-- --></A><H3>
sha1_vm_test</H3>
<PRE>
private static boolean <B>sha1_vm_test</B>()</PRE>
<DL>
<DD>This is a boolean returnig test function that exists in the sha1.js library. If it returns 'false' something is wrong. Creation date: (3/26/2004 1:05:01 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="str_hmac_sha1(java.lang.String, java.lang.String)"><!-- --></A><H3>
str_hmac_sha1</H3>
<PRE>
public static java.lang.String <B>str_hmac_sha1</B>(java.lang.String key, java.lang.String 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/26/2004 1:05:01 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="str_sha1(java.lang.String)"><!-- --></A><H3>
str_sha1</H3>
<PRE>
public static java.lang.String <B>str_sha1</B>(java.lang.String 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/26/2004 1:05:01 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="str2binb(java.lang.String)"><!-- --></A><H3>
str2binb</H3>
<PRE>
private static int[] <B>str2binb</B>(java.lang.String str)</PRE>
<DL>
<DD>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. Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - java.lang.String<DT><B>Returns:</B><DD>int[]</DL>
</DD>
</DL>
<HR>
<A NAME="strechBinArray(int[], int)"><!-- --></A><H3>
strechBinArray</H3>
<PRE>
private static int[] <B>strechBinArray</B>(int[] oldbin, int size)</PRE>
<DL>
<DD>increase an int array to a desired sized + 1 while keeping the old values. Creation date: (3/26/2004 1:05:01 PM)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - java.lang.String<DT><B>Returns:</B><DD>int[]</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SHA1.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
XG Project</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="SHA1.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<b>T.N.Silverman</b>, the author of this code, is the Project Manager of the <b>XG</b> project in <b>CTXM</b>. The people in this project produce client/server Flash/J2EE games for the Sport betting industry.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -