Java SHA sha(String strPlain)

Here you can find the source of sha(String strPlain)

Description

sha

License

Open Source License

Declaration

public static byte[] sha(String strPlain) 

Method Source Code

//package com.java2s;

import java.security.MessageDigest;

public class Main {

    public static byte[] sha(String strPlain) {
        byte s[] = null;
        try {//from  w ww. ja v  a 2 s  .co  m
            MessageDigest m = MessageDigest.getInstance("SHA-1");
            s = m.digest(strPlain.getBytes("utf-8"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return s;
    }
}

Related

  1. sha(byte data[])
  2. sha(byte[] data)
  3. SHA(String s)
  4. sha(String source)
  5. sha(String str)
  6. sha(String text, String encoding)
  7. sha2(String content)
  8. sha2(String input)
  9. sha2(String password)