You are viewing ljfoaf

LiveJournal FOAF -

Jul. 20th, 2004

10:13 am

Previous Entry Share Next Entry

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

Comments:

[User Picture]
From:vanbeast
Date:July 19th, 2004 11:33 pm (UTC)
(Link)
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.

[User Picture]
From:dimitry
Date:July 19th, 2004 11:36 pm (UTC)
(Link)
Thanks!
From:acheron_hades
Date:July 20th, 2004 05:15 am (UTC)
(Link)
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.
[User Picture]
From:crschmidt
Date:July 20th, 2004 05:38 am (UTC)
(Link)
For the foaf file, it's actually "mailto:foo@bar.com", because it's designed to be a resource.
From:acheron_hades
Date:July 20th, 2004 06:13 am (UTC)
(Link)
Good point :)
[User Picture]
From:humbleopinion
Date:July 21st, 2004 05:48 pm (UTC)

FOAF References

(Link)
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/
[User Picture]
From:dimitry
Date:July 21st, 2004 11:24 pm (UTC)

Re: FOAF References

(Link)
this is actually what I wanted - as a lazy programmer. lazy programmers prefer tools rather than coding%))))