Mercurial > hg4j
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 82:7255c971dd66 | 83:a5275143664c |
|---|---|
| 99 alg.update(buf, 0, c); | 99 alg.update(buf, 0, c); |
| 100 } | 100 } |
| 101 digest = alg.digest(); | 101 digest = alg.digest(); |
| 102 return this; | 102 return this; |
| 103 } | 103 } |
| 104 | |
| 105 public DigestHelper sha1(CharSequence... seq) { | |
| 106 MessageDigest alg = getSHA1(); | |
| 107 for (CharSequence s : seq) { | |
| 108 byte[] b = s.toString().getBytes(); | |
| 109 alg.update(b); | |
| 110 } | |
| 111 digest = alg.digest(); | |
| 112 return this; | |
| 113 } | |
| 104 | 114 |
| 105 public static String toHexString(byte[] data, final int offset, final int count) { | 115 public static String toHexString(byte[] data, final int offset, final int count) { |
| 106 char[] result = new char[count << 1]; | 116 char[] result = new char[count << 1]; |
| 107 final String hexDigits = "0123456789abcdef"; | 117 final String hexDigits = "0123456789abcdef"; |
| 108 final int end = offset+count; | 118 final int end = offset+count; |
