Java SHA1 SHA1(String strs)

Here you can find the source of SHA1(String strs)

Description

SHA

License

Apache License

Declaration

public static String SHA1(String strs) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {
    public static String SHA1(String strs) {
        byte[] _bytes = null;
        try {/*  w ww . ja v  a 2  s.co m*/
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(strs.getBytes());
            _bytes = md.digest();
        } catch (NoSuchAlgorithmException ex) {

        }
        return new BigInteger(1, _bytes).toString(16);

    }
}

Related

  1. sha1(String str)
  2. sha1(String str)
  3. SHA1(String str)
  4. sha1(String string)
  5. sha1(String string)
  6. sha1(String text)
  7. SHA1(String text)
  8. sha1(String text)
  9. SHA1(String text)