Convert JAVA method to the same functionality in PHP
为情所困
为情所困 2017-07-01 09:12:01
0
2
761

Because I only know PHP language, I can’t understand a Java method, and I don’t know how to implement it with PHP. Could you please give me some advice:
java source code is as follows:

MessageDigest md5 = MessageDigest.getInstance("MD5"); BASE64Encoder base64en = new BASE64Encoder(); // 加密后的字符串 String newstr = base64en.encode(md5.digest(str.getBytes("utf-8")));

How to implement the above method using PHP?

为情所困
为情所困

reply all (2)
Peter_Zhu
$newstr = base64_encode(md5($str,true));
    学习ing

    $newstr = base64_encode(md5(mb_convert_encoding($str,'utf-8')))

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!