On Friday 02 May 2008 11:09, j16sdiz at freenetproject.org wrote:
> Author: j16sdiz
> Date: 2008-05-02 10:09:13 +0000 (Fri, 02 May 2008)
> New Revision: 19674
> 
> Modified:
>    trunk/freenet/src/freenet/crypt/SHA256.java
> Log:
> limit number of cached SHA256 md

Any particular reason for a limit of 16? We use a lot of SHA256's...
> 
> 
> Modified: trunk/freenet/src/freenet/crypt/SHA256.java
> ===================================================================
> --- trunk/freenet/src/freenet/crypt/SHA256.java       2008-05-02 09:44:53 UTC 
> (rev 
19673)
> +++ trunk/freenet/src/freenet/crypt/SHA256.java       2008-05-02 10:09:13 UTC 
> (rev 
19674)
> @@ -105,6 +105,8 @@
>               String algo = md256.getAlgorithm();
>               if(!(algo.equals("SHA-256") || algo.equals("SHA256")))
>                       throw new IllegalArgumentException("Should be SHA-256 
> but is " + algo);
> +             if (digests.size() > 16) // don't cache too many of them
> +                     return;
>               md256.reset();
>               digests.add(md256);
>       }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080503/e52097d9/attachment.pgp>

Reply via email to