[Ironpython-users] Hashing a directory is magnitudes slower than in cPython

Doug Blank doug.blank at gmail.com
Tue Feb 25 14:03:00 CET 2014


I think I just wrote the relevant parts in C#, in a slightly different form:

public string sign(List<string> list) {
            hmac.Initialize();
            foreach (string item in list) {
byte [] sourcebytes = Encoding.UTF8.GetBytes(item);
                hmac.TransformBlock(sourcebytes, 0, sourcebytes.Length,
null, 0);
            }
            hmac.TransformFinalBlock(new byte [0], 0, 0);
    return BitConverter.ToString(hmac.Hash).Replace("-", "").ToLower();
}

Maybe that will be useful, or save someone a few minutes in researching.
Perhaps this can be sped up as well.

-Doug


On Tue, Feb 25, 2014 at 7:43 AM, Markus Schaber <m.schaber at codesys.com>wrote:

> Hi,
>
> I forgot to add the attachment...
>
> Best regards
>
> Markus Schaber
>
> CODESYS(r) a trademark of 3S-Smart Software Solutions GmbH
>
> Inspiring Automation Solutions
>
> 3S-Smart Software Solutions GmbH
> Dipl.-Inf. Markus Schaber | Product Development Core Technology
> Memminger Str. 151 | 87439 Kempten | Germany
> Tel. +49-831-54031-979 | Fax +49-831-54031-50
>
> E-Mail: m.schaber at codesys.com | Web: http://www.codesys.com | CODESYS
> store: http://store.codesys.com
> CODESYS forum: http://forum.codesys.com
>
> Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner |
> Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
>
>
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> https://mail.python.org/mailman/listinfo/ironpython-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20140225/50af1f00/attachment.html>


More information about the Ironpython-users mailing list