[Microid] MicroID Python code + comments on the spec

Eran Sandler eran at yedda.com
Wed Jan 3 12:54:54 EST 2007


Hey all,

Attached is a simple function implementation of microid in Python (after
seeing the Java implementation I had to do something ;-) ).

This sample is for Python 2.4 or so (in 2.5 the SHA API I'm using is
deprecated, so when I'll install it I'll submit a Python 2.5 valid sample).

It also contains a sample that you can run it by itself (and not include it
in a project). Run by specifying:
python microid.py firsturi seconduri

Where firsturi is the first uri you want to encode and the second is the
second.

For example:
python microid.py xmpp:stpeter at jabber.org https://www.xmpp.net/

This will produce (with the '======' lines):

========================================================================
first uri          : xmpp:stpeter at jabber.org
second uri         : https://www.xmpp.net/

microid hash value : 6196ea6709be2a4cbdf2bc0cfaeac491f2fb8921

microid            :
xmpp+https:sha1:6196ea6709be2a4cbdf2bc0cfaeac491f2fb8921
========================================================================

For the value of the microid printed, it will try to extract the protocol
used form the uris given in the input.

This also brings me to another point. I might be wrong on this, but I double
checked the hash values and the sample on the spec has the wrong hash
values. The ones I've listed above is the right ones (as far as I could
tell).

So it would be good to correct the sample so that people will be able to
verify that their sha1 hashing (at least for now) is working well.

Eran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: microid.zip
Type: application/x-zip-compressed
Size: 527 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/microid/attachments/20070103/b4f4c0c0/attachment.bin 


More information about the Microid mailing list