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

📄 stringutils.html

📁 开源项目smack的API文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<DD>Escapes all necessary characters in the String so that it can be used in an XML doc.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>string</CODE> - the string to escape.<DT><B>Returns:</B><DD>the string with appropriate characters escaped.</DL></DD></DL><HR><A NAME="hash(java.lang.String)"><!-- --></A><H3>hash</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>hash</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;data)</PRE><DL><DD>Hashes a String using the SHA-1 algorithm and returns the result as a String of hexadecimal numbers. This method is synchronized to avoid excessive MessageDigest object creation. If calling this method becomes a bottleneck in your code, you may wish to maintain a pool of MessageDigest objects instead of using this method. <p> A hash is a one-way function -- that is, given an input, an output is easily computed. However, given the output, the input is almost impossible to compute. This is useful for passwords since we can store the hash and a hacker will then have a very hard time determining the original password.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - the String to compute the hash of.<DT><B>Returns:</B><DD>a hashed version of the passed-in String</DL></DD></DL><HR><A NAME="encodeHex(byte[])"><!-- --></A><H3>encodeHex</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeHex</B>(byte[]&nbsp;bytes)</PRE><DL><DD>Encodes an array of bytes as String representation of hexadecimal.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bytes</CODE> - an array of bytes to convert to a hex string.<DT><B>Returns:</B><DD>generated hex string.</DL></DD></DL><HR><A NAME="encodeBase64(java.lang.String)"><!-- --></A><H3>encodeBase64</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeBase64</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;data)</PRE><DL><DD>Encodes a String as a base64 String.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - a String to encode.<DT><B>Returns:</B><DD>a base64 encoded String.</DL></DD></DL><HR><A NAME="encodeBase64(byte[])"><!-- --></A><H3>encodeBase64</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeBase64</B>(byte[]&nbsp;data)</PRE><DL><DD>Encodes a byte array into a base64 String.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - a byte array to encode.<DT><B>Returns:</B><DD>a base64 encode String.</DL></DD></DL><HR><A NAME="encodeBase64(byte[], boolean)"><!-- --></A><H3>encodeBase64</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeBase64</B>(byte[]&nbsp;data,                                  boolean&nbsp;lineBreaks)</PRE><DL><DD>Encodes a byte array into a bse64 String.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - The byte arry to encode.<DD><CODE>lineBreaks</CODE> - True if the encoding should contain line breaks and false if it should not.<DT><B>Returns:</B><DD>A base64 encoded String.</DL></DD></DL><HR><A NAME="encodeBase64(byte[], int, int, boolean)"><!-- --></A><H3>encodeBase64</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>encodeBase64</B>(byte[]&nbsp;data,                                  int&nbsp;offset,                                  int&nbsp;len,                                  boolean&nbsp;lineBreaks)</PRE><DL><DD>Encodes a byte array into a bse64 String.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - The byte arry to encode.<DD><CODE>offset</CODE> - the offset of the bytearray to begin encoding at.<DD><CODE>len</CODE> - the length of bytes to encode.<DD><CODE>lineBreaks</CODE> - True if the encoding should contain line breaks and false if it should not.<DT><B>Returns:</B><DD>A base64 encoded String.</DL></DD></DL><HR><A NAME="decodeBase64(java.lang.String)"><!-- --></A><H3>decodeBase64</H3><PRE>public static byte[] <B>decodeBase64</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;data)</PRE><DL><DD>Decodes a base64 String.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - a base64 encoded String to decode.<DT><B>Returns:</B><DD>the decoded String.</DL></DD></DL><HR><A NAME="randomString(int)"><!-- --></A><H3>randomString</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>randomString</B>(int&nbsp;length)</PRE><DL><DD>Returns a random String of numbers and letters (lower and upper case) of the specified length. The method uses the Random class that is built-in to Java which is suitable for low to medium grade security uses. This means that the output is only pseudo random, i.e., each number is mathematically generated so is not truly random.<p> The specified length must be at least one. If not, the method will return null.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>length</CODE> - the desired length of the random String to return.<DT><B>Returns:</B><DD>a random String of numbers and letters of the specified length.</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="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><b>Smack</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../org/jivesoftware/smack/util/ReaderListener.html" title="interface in org.jivesoftware.smack.util"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../org/jivesoftware/smack/util/WriterListener.html" title="interface in org.jivesoftware.smack.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html?org/jivesoftware/smack/util/StringUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="StringUtils.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;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright &copy; 2003-2007 Jive Software. </i></BODY></HTML>

⌨️ 快捷键说明

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