You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Henri Yandell <ba...@generationjava.com> on 2003/10/01 19:32:59 UTC

Re: [lang][codec] DigestUtils?

I've got such a thing myself:

http://www.osjava.org/genjava-core/apidocs/com/generationjava/security/Securer.html

and do believe it's a good thing.

However it's not within Lang's scope. Codec already has the other half the
equation [hex representations] so possibly this could fall withing Codec's
realm.

Hen

On Wed, 1 Oct 2003, Dave Dribin wrote:

> Would there be interest in a DigestUtils class that simplifies using
> java.security.MessageDigest objects?  Personally, I find it a huge
> pain to do a simple MD5 digest.  Also, it's often necessary to
> get the hex representation of the digest.  For starters, I would
> propose the following API:
>
>     public static String md5hex(String data);
>     public static String md5hex(bytes[] data);
>
>     public static byte[] md5(String data);
>     public static byte[] md5(bytes[] data);
>
> There could be similar methods for SHA digests.  I already have a
> non-polished implementation that I would be willing to submit (after
> polishing).
>
> -Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [lang][codec] DigestUtils?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
From: "Dave Dribin" <da...@dribin.org>
> On Wed, Oct 01, 2003 at 01:32:59PM -0400, Henri Yandell wrote:
> > However it's not within Lang's scope. Codec already has the other half
the
> > equation [hex representations] so possibly this could fall withing
Codec's
> > realm.
>
> Really?  As a user of commons-lang already, it seems to fall under the
> "helper utility" aspect, similar to the static methods of *Utils
> classes already present.  It's not providing any new codecs, just a
> facade around existing core Java objects.  For compatibilities sake, I
> did check when MessageDigest was included in Java core, and is
> included all the way back in JDK 1.2.
[lang] limits itself to java.lang, java.util and java.math packages. Really
basic classes. It is not a general place for utilities around any JDK class.


> I can provide the code and JUnit tests, and you guys can do whatever
> you like with 'em. :) Is this the appropriate list?  What's the proper
> method to transfer copyright to ASF?
Simply change the license before you send it will generally do.

Stephen


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [lang][codec] DigestUtils?

Posted by Dave Dribin <da...@dribin.org>.
On Wed, Oct 01, 2003 at 01:32:59PM -0400, Henri Yandell wrote:
> 
> I've got such a thing myself:
> 
> http://www.osjava.org/genjava-core/apidocs/com/generationjava/security/Securer.html
> 
> and do believe it's a good thing.

Yeah, it's seems fairly common to write a wrapper.

> However it's not within Lang's scope. Codec already has the other half the
> equation [hex representations] so possibly this could fall withing Codec's
> realm.

Really?  As a user of commons-lang already, it seems to fall under the
"helper utility" aspect, similar to the static methods of *Utils
classes already present.  It's not providing any new codecs, just a
facade around existing core Java objects.  For compatibilities sake, I
did check when MessageDigest was included in Java core, and is
included all the way back in JDK 1.2.

I can provide the code and JUnit tests, and you guys can do whatever
you like with 'em. :) Is this the appropriate list?  What's the proper
method to transfer copyright to ASF?

-Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [lang][codec] DigestUtils?

Posted by David Graham <gr...@yahoo.com>.
--- Tim O'Brien <to...@discursive.com> wrote:
> On Wed, 1 Oct 2003, Henri Yandell wrote:
> > I've got such a thing myself:
> > 
> >
>
http://www.osjava.org/genjava-core/apidocs/com/generationjava/security/Securer.html
> > 
> > and do believe it's a good thing.
> > 
> > However it's not within Lang's scope. Codec already has the other half
> the
> > equation [hex representations] so possibly this could fall withing
> Codec's
> > realm.
> 
> I believe that at one point a while back we had a contribution that did 
> just that, but for some reason it wasn't included in the 1.1 release. 

That contribution came from Struts and the ticket can be found here:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20990

It was closed as WONTFIX though.

David

> If 
> there is a utility class that already exists, it should be added into a 
> "digest" package.
> 
> 
> 
> > 
> > Hen
> > 
> > On Wed, 1 Oct 2003, Dave Dribin wrote:
> > 
> > > Would there be interest in a DigestUtils class that simplifies using
> > > java.security.MessageDigest objects?  Personally, I find it a huge
> > > pain to do a simple MD5 digest.  Also, it's often necessary to
> > > get the hex representation of the digest.  For starters, I would
> > > propose the following API:
> > >
> > >     public static String md5hex(String data);
> > >     public static String md5hex(bytes[] data);
> > >
> > >     public static byte[] md5(String data);
> > >     public static byte[] md5(bytes[] data);
> > >
> > > There could be similar methods for SHA digests.  I already have a
> > > non-polished implementation that I would be willing to submit (after
> > > polishing).
> > >
> > > -Dave
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > 
> > 
> > 
> 
> -- 
> ----------------------
> Tim O'Brien
> Evanston, IL
> (847) 863-7045
> tobrien@discursive.com
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [lang][codec] DigestUtils?

Posted by Tim O'Brien <to...@discursive.com>.
On Wed, 1 Oct 2003, Henri Yandell wrote:
> I've got such a thing myself:
> 
> http://www.osjava.org/genjava-core/apidocs/com/generationjava/security/Securer.html
> 
> and do believe it's a good thing.
> 
> However it's not within Lang's scope. Codec already has the other half the
> equation [hex representations] so possibly this could fall withing Codec's
> realm.

I believe that at one point a while back we had a contribution that did 
just that, but for some reason it wasn't included in the 1.1 release.  If 
there is a utility class that already exists, it should be added into a 
"digest" package.



> 
> Hen
> 
> On Wed, 1 Oct 2003, Dave Dribin wrote:
> 
> > Would there be interest in a DigestUtils class that simplifies using
> > java.security.MessageDigest objects?  Personally, I find it a huge
> > pain to do a simple MD5 digest.  Also, it's often necessary to
> > get the hex representation of the digest.  For starters, I would
> > propose the following API:
> >
> >     public static String md5hex(String data);
> >     public static String md5hex(bytes[] data);
> >
> >     public static byte[] md5(String data);
> >     public static byte[] md5(bytes[] data);
> >
> > There could be similar methods for SHA digests.  I already have a
> > non-polished implementation that I would be willing to submit (after
> > polishing).
> >
> > -Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> 

-- 
----------------------
Tim O'Brien
Evanston, IL
(847) 863-7045
tobrien@discursive.com



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org