Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/DigestHelper.java @ 83:a5275143664c
Complete path hash calculation of fncache requirement
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 25 Jan 2011 22:44:14 +0100 |
parents | 6f1b88693d48 |
children | a3a2e5deb320 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DigestHelper.java Tue Jan 25 04:14:42 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/DigestHelper.java Tue Jan 25 22:44:14 2011 +0100 @@ -101,6 +101,16 @@ digest = alg.digest(); return this; } + + public DigestHelper sha1(CharSequence... seq) { + MessageDigest alg = getSHA1(); + for (CharSequence s : seq) { + byte[] b = s.toString().getBytes(); + alg.update(b); + } + digest = alg.digest(); + return this; + } public static String toHexString(byte[] data, final int offset, final int count) { char[] result = new char[count << 1];