/** * Short tool to check the hashcode of a file called MyClient$MyThread.class. The output can be used in MyServer.java to ensure * the client is the right client. */ import java.nio.file.*; import java.io.*; import java.security.MessageDigest; public class HashCodeChecker{ public static void main(String args[]) throws Exception{ byte[] file = Files.readAllBytes(FileSystems.getDefault().getPath("MyClient$MyThread.class")); MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(file); String result = ""; for(byte b : md.digest()){ result += String.format("%02x", b); } System.out.println(result); } }