Web::MicroID - An implementation of the MicroID standard
This documentation refers to Web::MicroID version 0.02
use Web::MicroID; $id = Web::MicroID->new(); $id->individual('mailto:user@domain.tld'); $id->serv_prov('http://domain.tld/');
# Generate a MicroID token $micro_id = $id->generate();
# Process (validate) a MicroID token $test = $id->process($micro_id);
This module is used to generate or process a MicroID token.
None by default.
http://microid.org/
The new() constructor doesn't require any arguments.
$id = Web::MicroID->new();
You can optionally set the value of one or all these methods.
$id = Web::MicroID->new( { algorithm => $algorithm individual => $individual, serv_prov => $serv_prov, process => $process, } );
Will set or get the value for an individual's ID.
$individual = 'mailto:user@domain.tld'; $id->individual($individual);
or
$individual = $id->individual();
Will get the URI type of the individual's ID (e.g., 'mailto').
Will get the URI value for the individual's URI (e.g., 'user@domain.tld').
Will set or get the value for the service provider's ID.
$serv_prov = 'http://domain.tld/'; $id->serv_prov($serv_prov);
$serv_prov = $id->serv_prov();
Will get the URI type for the service provider's ID (e.g., 'http').
Will get the URI value of the service provider's ID (e.g., 'domain.tld').
Will set or get the algorithm method. Either (md5 or sha1), defaults to 'sha1'.
$algorithm = 'md5'; $id->algorithm($algorithm);
$algorithm = $id->algorithm();
Generate a MicroID token
$micro_id = $id->generate();
Well get the hash portion of the MicroID token.
$legacy = id->legacy();
Sets and processes (validates) a MicroID token. Works with both conforming and legacy MicroID specs. Returns true if successful, undefined on failure.
$test = $id->process( 'mailto+http:sha1:7964877442b3dd0b5b7487eabe264aa7d31f463c'; );
$test = $id->process();
Digest::SHA1 Digest::MD5
There are no known bugs in this module. Please report problems to the author.
Patches are welcome.
Jim Walker, <jim@reclaw.com>
Copyright (c) 2007 Jim Walker, <jim@reclaw.com> All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Web::MicroID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::MicroID
CPAN shell
perl -MCPAN -e shell install Web::MicroID
For more information on module installation, please visit the detailed CPAN module installation guide.