me.xethh.libs.toolkits.encryption.Digest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons Show documentation
Show all versions of commons Show documentation
Library of common used tools - major focus on common tools
The newest version!
package me.xethh.libs.toolkits.encryption;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
public class Digest {
public static void digestStream(InputStream is, MessageDigest digest, int byteSize){
byte[] b = new byte[byteSize];
try {
while (is.read(b) != -1){
digest.update(b);
}
} catch (IOException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
}