Skip to Content.
Sympa Menu

microid - [Microid] PHP code for generating MicroID

microid AT lists.ibiblio.org

Subject: Microid mailing list

List archive

Chronological Thread  
  • From: eran AT yedda.com
  • To: microid AT lists.ibiblio.org
  • Subject: [Microid] PHP code for generating MicroID
  • Date: Sat, 06 Jan 2007 15:29:00 -0700

Hey all,

This is a very simple PHP page with a PHP function that generates MicroIDs.

<?php

function generate_microid($firstUri, $secondUri) {
$firstUriHash = sha1($firstUri);
$secondUriHash = sha1($secondUri);

return sha1($firstUriHash . $secondUriHash);
}


$firstUri = "xmpp:stpeter AT jabber.org";
$secondUri = "https://www.xmpp.net/";;

?>


<div>First Uri : <? echo $firstUri; ?></div>
<div>Second Uri: <? echo $secondUri; ?></div>
<div>MicroID: <? echo generate_microid($firstUri, $secondUri); ?>
</div>

After writing the MicroID plugin for WordPress
(http://eran.sandler.co.il/microid-wordpress-plugin/) I thought it would be
useful to post it as an example as well (even though its VERY trivial ;-) ).

Eran



  • [Microid] PHP code for generating MicroID, eran, 01/06/2007

Archive powered by MHonArc 2.6.24.

Top of Page