📄 main.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package sha1lab;/** * * @author Fredrik */public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // Hash the test messages in the SHA-1 standard document String message="abc"; byte[] messageByte=message.getBytes(); for(int i=0;i<messageByte.length;i++) System.out.printf("%02x ",messageByte[i]); System.out.println(); SHA1 hashFunction = new SHA1(); byte[] hashVal=hashFunction.hash(messageByte); for(int i=0;i<20;i++) System.out.printf("%02x ",hashVal[i]); System.out.println(); message="abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; messageByte=message.getBytes(); hashVal=hashFunction.hash(messageByte); for(int i=0;i<20;i++) System.out.printf("%02x ",hashVal[i]); System.out.println(); messageByte=new byte[1000000]; for(int i=0;i<1000000;i++) messageByte[i]="a".getBytes()[0]; hashVal=hashFunction.hash(messageByte); for(int i=0;i<20;i++) System.out.printf("%02x ",hashVal[i]); System.out.println(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -