[rdfweb-dev] Foaf-a-matic SHA1 converter

Taral taral at taral.net
Sun Aug 1 22:14:13 UTC 2004


On Sun, Aug 01, 2004 at 04:53:30PM -0400, Matthew Leingang wrote:
> Works now, great.  For posterity, the python code looks like
> 
>             mbox = "mailto:leingang at math.harvard.edu"
>             import sha
>             sha = sha.new()
>             sha.update(mbox)
>             mbox_sha1sum = sha.hexdigest()
> 
> I don't know if there's a cool one-liner, as I've only been using python for
> about a week.

sha1sum:
% echo -n 'mailto:leingang at math.harvard.edu' | sha1sum
bfbf875c7d2aced45a00874d1cfc66f132ac1fc4  -

python:
>>> import sha; print sha.sha('mailto:leingang at math.harvard.edu').hexdigest()
bfbf875c7d2aced45a00874d1cfc66f132ac1fc4

openssl:
% echo -n 'mailto:leingang at math.harvard.edu' | openssl dgst -sha1
bfbf875c7d2aced45a00874d1cfc66f132ac1fc4

-- 
Taral <taral at taral.net>
This message is digitally signed. Please PGP encrypt mail to me.
"Some people cause happiness wherever they go; others, whenever they go."
    -- Oscar Wilde
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.usefulinc.com/pipermail/foaf-dev/attachments/20040801/e97c0c46/attachment-0001.pgp


More information about the foaf-dev mailing list