Home > Backend Development > PHP Tutorial > java - 哪位大哥帮忙翻译成PHP?

java - 哪位大哥帮忙翻译成PHP?

WBOY
Release: 2016-06-06 20:49:30
Original
912 people have browsed it

哪位大哥帮忙翻译成PHP? JAVA不懂, 对方没有PHP SDK 谢谢了.

<code class="lang-java">/**
   * 签名算法
   * 
   * @return
   * @throws Exception
   */
   public static String createSign(String param) throws Exception {
       StringBuffer result = new StringBuffer();
       MessageDigest md5 = MessageDigest.getInstance("MD5");
       md5.update(param.getBytes("UTF-8"));
       byte[] b = md5.digest();
       for(int i=0;i>>4;
           int l = x&0x0F;
           result.append((char)(h+((h</code>
Copy after login
Copy after login

回复内容:

哪位大哥帮忙翻译成PHP? JAVA不懂, 对方没有PHP SDK 谢谢了.

<code class="lang-java">/**
   * 签名算法
   * 
   * @return
   * @throws Exception
   */
   public static String createSign(String param) throws Exception {
       StringBuffer result = new StringBuffer();
       MessageDigest md5 = MessageDigest.getInstance("MD5");
       md5.update(param.getBytes("UTF-8"));
       byte[] b = md5.digest();
       for(int i=0;i>>4;
           int l = x&0x0F;
           result.append((char)(h+((h</code>
Copy after login
Copy after login

<code class="lang-php">function create_sign($src){
    return substr(md5($src), 8, 16);
}
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template