(Untitled)

Jul 20, 2004 10:13

Hello everyone, I have a very simple question - how to(using what) calculate a hash of my e-mail address?

Leave a comment

Comments 7

vanbeast July 19 2004, 23:33:15 UTC
LiveJournal does a hex-encoded SHA-1 hash of "mailto:email@address.com", substituting, of course, your email address.

In perl, you could do this:

use Digest::SHA1;
Digest::SHA1::sha1_hex('mailto:youremail@address.com');

Which of course requires that you've got Digest::SHA1 installed. Other programming languages will have their own ways of pulling that off.

Reply

dimitry July 19 2004, 23:36:30 UTC
Thanks!

Reply


acheron_hades July 20 2004, 05:15:03 UTC
Do you mean programatically, or just to have something to stick in your FOAF file? If the latter, the following would work on most unixy systems:

echo -n 'foo@bar.com' | md5sum

or

echo -n 'foo@bar.com' | sha1sum

depending on the algo you want to use.

Reply

crschmidt July 20 2004, 05:38:04 UTC
For the foaf file, it's actually "mailto:foo@bar.com", because it's designed to be a resource.

Reply

acheron_hades July 20 2004, 06:13:05 UTC
Good point :)

Reply


FOAF References humbleopinion July 21 2004, 17:48:17 UTC
If you are just trying to get the hash of your address, there are several tools at http://xml.mfd-consult.dk/foaf/ one of which will sh1ify your address.

If you are looking for the spec, it is located at http://xmlns.com/foaf/0.1/

Reply

Re: FOAF References dimitry July 21 2004, 23:24:01 UTC
this is actually what I wanted - as a lazy programmer. lazy programmers prefer tools rather than coding%))))

Reply


Leave a comment

Up