MD5 encryption

xiaoxiao2021-03-06  41

Package com.tzsw.emhr.relief.rtpub;

Import java.security. *; import java.math. *;

Public class testmd5 {public string md5 (String Sinput) throws exception {string algorithm = ""; // Input cannot be empty IF (SINPUT.TRIM () == null) {return "null";} // Specify Using MD5 algorithm try {algorithm = System.getProperty ( "MD5.algorithm", "MD5");} catch (SecurityException se) {} // define MessageDigest object MessageDigest md = MessageDigest.getInstance (algorithm); // system according to the default character The encoding method converts SINPUT into bytes and saves the result to a new byte array buffer BYTE BUFFER [] = SINPUT.GETBYTES (); // Starting from the specified byte array buffer offset 0 The specified byte array modification is generated by the SINPUT to generate a summary of the number length used from 0. For (int count = 0; count

转载请注明原文地址:https://www.9cbs.com/read-54784.html

New Post(0)