Java SHA1 SHA1(final String text)

Here you can find the source of SHA1(final String text)

Description

SHA

License

Apache License

Declaration

public static byte[] SHA1(final String text) throws Exception 

Method Source Code

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

import java.security.MessageDigest;

public class Main {
    public static byte[] SHA1(final String text) throws Exception {
        final MessageDigest md = MessageDigest.getInstance("SHA-1");
        md.update(text.getBytes("iso-8859-1"), 0, text.length());
        final byte[] sha1hash = md.digest();
        return sha1hash;
    }//from  w ww  . j a  v a2s.c o m
}

Related

  1. sha1(final File file)
  2. sha1(final String data)
  3. sha1(final String str)
  4. sha1(final String string)
  5. sha1(final String text)
  6. sha1(final String todigest)
  7. SHA1(InputStream in)
  8. SHA1(MessageDigest messageDigest, String... texts)
  9. sha1(Object object)