Skip to Content.
Sympa Menu

microid - Re: [Microid] Encode URLs?

microid AT lists.ibiblio.org

Subject: Microid mailing list

List archive

Chronological Thread  
  • From: Peter Saint-Andre <stpeter AT jabber.org>
  • To: james AT cridland.net
  • Cc: microid AT lists.ibiblio.org
  • Subject: Re: [Microid] Encode URLs?
  • Date: Mon, 16 Apr 2007 10:14:42 -0600

James Cridland wrote:
I'm trying to produce a microid metatag for my page at
http://www.mediauk.com/discussions/profile.muk?mode=viewprofile&u=1 <http://www.mediauk.com/discussions/profile.muk?mode=viewprofile&u=1>
(indeed, I own this site, and verify all email addresses, so I'm trying to produce microids for all users)

I use this PHP code to produce a microid.
$microid_email = " james AT cridland.net <mailto:james AT cridland.net>";
$microid_url="http://www.mediauk.com/discussions/profile.muk?mode=viewprofile&u=1 <http://www.mediauk.com/discussions/profile.muk?mode=viewprofile&u=1>";
$microid_hex = sha1( sha1( "mailto:"; . trim($microid_email) ) + sha1( trim($microid_url) ) );
$microid_hex = "mailto+http:sha1:".$microid_hex;

Using this PHP code, I get a microid of
mailto+http:sha1:1268bb6d577107e328ccc6341e75da96f31277db

Using the JavaScript code at http://microid.org/ and my email address, I get
mailto+http:sha1:05d7b7fe2c3a67fab3982b50c9a727c04c9aab9c

Do I need to encode URLs or something? (It's not clear from the spec)

AFAICS, URIs within MicroID need to conform to RFC 3986. Therefore percent-encoding (%hexhex) would be required for certain characters. For your web page address ...

http://www.mediauk.com/discussions/profile.muk?mode=viewprofile&u=1

... that would necessitate encoding the characters "&", "=", and "?" as "%26", "%3D", and "%3F" ...

http://www.mediauk.com/discussions/profile.muk%3Fmode%3Dviewprofile%26u%3D1

Or so it seems to me.

Peter

--
Peter Saint-Andre
XMPP Standards Foundation
http://www.xmpp.org/xsf/people/stpeter.shtml

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature




Archive powered by MHonArc 2.6.24.

Top of Page