Travis Bemann writes:
    Actually, I've also written a Python client module for Freenet,
    but the SHA1 implementation is broken do to differences because
    the implementations of SHA1 that I have seen are either dependent
    on variable sizes or number wraparound.  Of course, Python doesn't
    allow either of these.  Could you email me your implementation...

The following seems to work (yes, another Python hacker in the midst):

from struct import *
import sha
def HexSha(s):
        return "%X%X%X%X%X" % unpack("!lllll", sha.new(s).digest())

_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to