Here you can find the source of hash(String strPlain)
Parameter | Description |
---|---|
strPlain | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static String hash(String strPlain)
//package com.java2s; public class Main { /**/*from w w w . j ava2s . co m*/ * Hash * @param strPlain * @return * @throws Exception */ public static String hash(String strPlain) { return String.valueOf(strPlain.hashCode()); // MessageDigest md; // try { // md = MessageDigest.getInstance("SHA"); // BASE64Encoder base = new BASE64Encoder (); // String pwdAfter = base.encode(md.digest(strPlain.getBytes())); // return pwdAfter; // } catch (NoSuchAlgorithmException e) { // ; // } // return ""; } /** * transform a Obejct 2 a String ,return value is "" when object is null * @param obj * @return * @author qiumm */ public static String valueOf(Object obj) { return (obj == null) ? "" : obj.toString(); } }