Joakim, Is this based on any work from commons or have you implemented this stuff from whats provided in the JDK?
James On Tue, 2008-04-08 at 21:54 -0700, Joakim Erdfelt wrote: > Joakim Erdfelt wrote: > > I've been taking a stab and removing some of our dependencies on > > various plexus components. > > > > First up, plexus-digest. > > > > I've taken the varied code from many locations and come up with a > > stand alone archiva-checksum lib/component that I hope to be able to > > integrate into archiva/trunk. > > > > So ... uhm ... consider this a call for discussion. ;-) > > > > - Joakim > > > Some more details... > > These are 4 classes present in archiva-checksum > 1) org/apache/archiva/checksum/Hash.java > 2) org/apache/archiva/checksum/Hasher.java > 3) org/apache/archiva/checksum/Hex.java > 4) org/apache/archiva/checksum/ChecksumFile.java > > This is how the replacements work ... > > Hash.class is an enum identifying the types of Hash functions (currently > only SHA1 and MD5), with a few details on ids that the hash techniques > expose. > This is similar in scope, but not a 100% replacement for ... > org/codehaus/plexus/digest/Sha1Digester.java > org/codehaus/plexus/digest/Md5Digester.java > org/codehaus/plexus/digest/StreamingSha1Digester.java > > Hasher.class is the main hashing routines, stream based, and has a few > optimizations for performing bulk or group hashing based on a single > stream, without processing the stream multiple times (one for each hash). > Hasher.class replaces the following classes in plexus-digest > org/codehaus/plexus/digest/Digester.java > org/codehaus/plexus/digest/StreamingDigester.java > > Hex.class is just a simple utility class to convert a byte array to a > Hex string. > It is a suitable replacement for plexus-digest > org/codehaus/plexus/digest/Hex.java > > ChecksumFile.class is the file specific implementation, for dealing with > the .md5 and .sha1 files (parsing, validating, creating, etc..) > It is a replacement for plexus-digest > org/codehaus/plexus/digest/ChecksumFile.java > org/codehaus/plexus/digest/DigestUtils.java > And also covers the logic present in archiva-common too > org/apache/maven/archiva/common/utils/Checksums.java > > - Joakim
