Android SHA1 Hash Create dataDigest(String in)

Here you can find the source of dataDigest(String in)

Description

data Digest

Declaration

private static byte[] dataDigest(String in)
            throws NoSuchAlgorithmException, UnsupportedEncodingException 

Method Source Code

//package com.java2s;
import java.io.UnsupportedEncodingException;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {
    private static byte[] dataDigest(String in)
            throws NoSuchAlgorithmException, UnsupportedEncodingException {
        if (in == null)
            return null;

        MessageDigest md = MessageDigest.getInstance("SHA-1");
        return md.digest(in.getBytes("UTF8"));
    }//from w  w  w  .  j av a2s.  co m
}

Related

  1. SHA1(String str)
  2. sha512(String what_to_encode)
  3. SHA1(String text)
  4. SHA1(String s)
  5. SHA1(String text)
  6. SHA256(String text)
  7. HashPassword(String text)