59606162636465
public static Sha1Hash sha1(byte[] plainText) { MessageDigest digest = getThreadLocalSha1(); byte[] hash = digest.digest(plainText); return new Sha1Hash(hash); }
66676869707172
public static Sha1Hash sha1(String a) { MessageDigest digest = getThreadLocalSha1(); byte[] hash = digest.digest(toBytesUtf8(a)); return new Sha1Hash(hash); }
102103104105106107108
public static Sha1Hash sha1(byte[] buffer1, byte[] buffer2) { MessageDigest digest = getThreadLocalSha1(); digest.update(buffer1); byte[] hash = digest.digest(buffer2); return new Sha1Hash(hash); }
110111112113114115116
public static Sha1Hash sha1(String a, String b) { MessageDigest digest = getThreadLocalSha1(); digest.update(toBytesUtf8(a)); byte[] hash = digest.digest(toBytesUtf8(b)); return new Sha1Hash(hash); }
121122123124125126127
for (int i = 0; i < data.length - 1; i++) { digest.update(toBytesUtf8(data[i])); } byte[] hash = digest.digest(toBytesUtf8(data[data.length - 1])); return new Sha1Hash(hash); }
130131132133134135136
MessageDigest digest = getThreadLocalSha1(); digest.update(a); digest.update(b); byte[] hash = digest.digest(c); return new Sha1Hash(hash); }
141142143144145146147
for (int i = 0; i < data.length - 1; i++) { digest.update(data[i]); } byte[] hash = digest.digest(data[data.length - 1]); return new Sha1Hash(hash); }
320321322323324325326
} } public static Sha1Hash sha1(InputStream inputStream) throws IOException { MessageDigest digest = getThreadLocalSha1(); return new Sha1Hash(hash(digest, inputStream).hash); }
392393394395396397398
} } public static Sha1Hash sha1(File file) throws IOException { MessageDigest digest = getThreadLocalSha1(); return new Sha1Hash(hash(digest, file).hash); }