You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Michael Parker <pa...@pobox.com> on 2004/04/21 21:25:48 UTC

SHA1 Binary Hash

We currently have a hex version of the SHA1 hash, but don't have
anything for the binary version.  Anyone have something that we can
use for that?  The flip side would be just going ahead and making
Digest::SHA1 a required module.

Michael

Re: SHA1 Binary Hash

Posted by Sidney Markowitz <si...@sidney.com>.
The perl SHA1 checkin has been checked on a several different big-endian 
and 64 bit machines, so I don't need any more volunteers.

Thank you Kelsey and Daniel for helping out.

  -- sidney


Re: SHA1 Binary Hash

Posted by Daniel Quinlan <qu...@pathname.com>.
Sidney Markowitz <si...@sidney.com> writes:

> still works on it after updating to my latest checkin? I realized that 
> if I made a mistake in my last change it is likely to be something that 
> assumed little-endian and 32 bit as I only had PCs to test on.

If you have a sourceforge account, you can ssh to shell.sourceforge.net
and there's usually a big-endian machine there.  It's a bit tricky
getting data off of a shell machine, but you just need to test it.

Daniel

-- 
Daniel Quinlan                     anti-spam (SpamAssassin), Linux,
http://www.pathname.com/~quinlan/    and open source consulting

Re: SHA1 Binary Hash

Posted by Sidney Markowitz <si...@sidney.com>.
If anybody has access to a big-endian machine or a 64 bit machine, could 
you verify that

  make test TEST_FILES="t/sha1.t"

still works on it after updating to my latest checkin? I realized that 
if I made a mistake in my last change it is likely to be something that 
assumed little-endian and 32 bit as I only had PCs to test on.

Thanks,

  -- sidney


Re: SHA1 Binary Hash

Posted by Michael Parker <pa...@pobox.com>.
On Thu, Apr 22, 2004 at 12:26:12PM +1200, Sidney Markowitz wrote:
> Daniel Quinlan wrote:
> >Adding a binary version to our module should be pretty easy.
> 
> Ok, it's checked in. There is now a function 
> Mail::SpamAssassin::SHA1::sha1bin that is exported along with 
> Mail::SpamAssassin::SHA1::sha1

Thanks.

> Both will use Digest::SHA1 if it is available, otherwise a slow pure 
> perl version. Someone should document that Digest::SHA1 is strongly 
> recommended if Bayes SQL is being used.

Strongly recommended if you use Bayes, period.

Michael

Re: SHA1 Binary Hash

Posted by Sidney Markowitz <si...@sidney.com>.
Daniel Quinlan wrote:
> Adding a binary version to our module should be pretty easy.

Ok, it's checked in. There is now a function 
Mail::SpamAssassin::SHA1::sha1bin that is exported along with 
Mail::SpamAssassin::SHA1::sha1

Both will use Digest::SHA1 if it is available, otherwise a slow pure 
perl version. Someone should document that Digest::SHA1 is strongly 
recommended if Bayes SQL is being used.

I also updated t/sha1.t to test it all.

  -- sidney


Re: SHA1 Binary Hash

Posted by Sidney Markowitz <si...@sidney.com>.
Daniel Quinlan wrote:
> Adding a binary version to our module should be pretty easy.

I have it. I'll check it in. I'll also change t/sha1.t because that 
directly calls an internal function that I will want to change slightly. 
As long as I am touching it I'll have it test both the binary and the 
hex versions.

  -- sidney


Re: SHA1 Binary Hash

Posted by Daniel Quinlan <qu...@pathname.com>.
Michael Parker <pa...@pobox.com> writes:

> We currently have a hex version of the SHA1 hash, but don't have
> anything for the binary version.  Anyone have something that we can
> use for that?  The flip side would be just going ahead and making
> Digest::SHA1 a required module.

Adding a binary version to our module should be pretty easy.

I'd make it a strong recommendation if someone is using Bayes with SQL.
Performance is likely to be poor without Digest::SHA1.

-- 
Daniel Quinlan                     anti-spam (SpamAssassin), Linux,
http://www.pathname.com/~quinlan/    and open source consulting