Which eldest brother helped translate it into PHP? I Don't Understand JAVA. the other party does not have PHPSDK. Thank you. {code...} Which eldest brother helped translate it into PHP? JAVA doesn't understand. The other party does not have the php sdk. Thank you.
/*** Signature algorithm ** @ 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 <B. length; ++ I) {int x = B [I] & 0xFF; int h = x >>> 4; int l = x & 0x0F; result. append (char) (h + (h <10 )? '0': 'A'-10); result. append (char) (l + (l <10 )? '0': 'A'-10);} return result. toString (). substring (8, 24 );}
Reply content:
Which eldest brother helped translate it into PHP? JAVA doesn't understand. The other party does not have the php sdk. Thank you.
/*** Signature algorithm ** @ 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 <B. length; ++ I) {int x = B [I] & 0xFF; int h = x >>> 4; int l = x & 0x0F; result. append (char) (h + (h <10 )? '0': 'A'-10); result. append (char) (l + (l <10 )? '0': 'A'-10);} return result. toString (). substring (8, 24 );}
function create_sign($src){ return substr(md5($src), 8, 16);}