?? 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 + -