-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHashing.java
More file actions
30 lines (28 loc) · 783 Bytes
/
Hashing.java
File metadata and controls
30 lines (28 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ekraal;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
*
* @author root
*/
public class Hashing
{
public static void HashMe(String Input) throws NoSuchAlgorithmException
{
System.out.println("Input "+ Input);
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] Hash = digest.digest(Input.getBytes());
BigInteger number = new BigInteger(1, Hash);
System.out.println(number.toString(16));
}
public static void main(String [] args) throws NoSuchAlgorithmException
{
HashMe("");
}
}