Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.security.MessageDigest;

public class Main {
    static byte[] encryptStreamBytes(byte[] streambytes) {
        return createSHA1Digest().digest(streambytes);
    }

    private static MessageDigest createSHA1Digest() {
        MessageDigest digest = null;
        try {
            digest = MessageDigest.getInstance("SHA-1");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return digest;
    }
}