Subject: [Instant-dev] Use of SHA1 in signatures.py

From: Anders Logg <[email-masked]>
Date: Thu, 11 Sep 2008 14:26:57 +0200

From help(hashlib):

  Named constructor functions are also available, these are much faster
  than using new():
    
  md5(), sha1(), sha224(), sha256(), sha384(), and sha512()

I suggest using hashlib.sha1 directly.

-- 
Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Thu, 11 Sep 2008 14:45:24 +0200

I tried it, and calling new('sha1') was twice as fast as calling
sha1() directly (0.8e-6 s per call vs 1.7e-6 s per call!), and running
a hundred updates on the object had the same timing.

-- 
Martin

2008/9/11 Anders Logg <[email-masked]>:
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIyQ6RTuwUCDsYZdERAlGyAKCEuWFdgRYFwpNbt4lpCejv9DZNZQCfQhjK
> FJoXwMYJNShD1hrH8f9Ck5s=
> =SL+9
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Instant-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/instant-dev
>
>

---

From: Anders Logg <[email-masked]>
Date: Thu, 11 Sep 2008 14:49:38 +0200

ok, so the manual is wrong. I'll change to new('sha1') in FFC.

-- 
Anders

---

From: Anders Logg <[email-masked]>
Date: Sun, 14 Sep 2008 23:50:42 +0200

> ok, so the manual is wrong. I'll change to new('sha1') in FFC.

(FFC still uses sha1 directly because something broke when I tried
using new() and it's wasn't important enough to spend time debugging.)

-- 
Anders