Skip to content

m5d Checksum #19

@WilliamKMLai

Description

@WilliamKMLai

New major Tab to add: File Utilities
This tools should NOT replace the built-in unix tool. It exists only for usage on systems where the existing tool is not readily available.

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.xml.bind.DatatypeConverter;

public class MD5 {
public static void main(String[] args) throws NoSuchAlgorithmException, IOException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(Files.readAllBytes(Paths.get("Reb1_Rhee.bed")));
byte[] digest = md.digest();
String myHash = DatatypeConverter.printHexBinary(digest).toLowerCase();
System.out.println(myHash);
}
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions