Reduce the scope of the query to reduce FPs

This commit is contained in:
luchua-bc
2021-02-14 14:59:53 +00:00
parent ff1ed3a012
commit 6a6727fc80
4 changed files with 123 additions and 89 deletions

View File

@@ -0,0 +1,21 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SHA512 implements HASH {
MessageDigest md;
public int getBlockSize() {return 32;}
public void init() throws NoSuchAlgorithmException {
try { md = MessageDigest.getInstance("SHA-512"); }
catch (Exception e){
System.err.println(e);
}
}
public void update(byte[] foo, int start, int len) throws NoSuchAlgorithmException {
md.update(foo, start, len);
}
public byte[] digest() throws NoSuchAlgorithmException {
return md.digest();
}
}