Crypt_MicroID
[ class tree: Crypt_MicroID ] [ index: Crypt_MicroID ] [ all elements ]

Class: Crypt_MicroID

Source Location: /Crypt_MicroID-0.1.0/Crypt/MicroID.php

Class Overview


Crypt_MicroID


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 53]
Crypt_MicroID

  1.  <?php
  2.  require_once 'Crypt/MicroID.php';
  3.  try {
  4.      $microID Crypt_MicroID::generate('xmpp:stpeter@jabber.org''https://www.xmpp.net/');
  5.      echo $microID;
  6.      echo $e->getMessage();
  7.  }
  8.  ?>



[ Top ]


Method Detail

generate   [line 76]

string generate( string $identity, string $service, [string $algorithm = self::ALGORITHM], [boolean $legacy = false])

Compute a MicroID for the given identity and service URIs.

Parameters:

string   $identity   —  identity URI
string   $service   —  service URI
string   $algorithm   —  algorithm used to calculating the hash
boolean   $legacy   —  if true, uritypes and algorithm will not be prefixed to the generated microid

[ Top ]

verify   [line 139]

boolean verify( string $identity, string $service, string $microID)

Compute a MicroID for the given identity and service URIs and verify that it matches the provided MicroID.

The provided ID can be in the legacy format (without URI types or algorithm), in which case the SHA1 algorithm will be assumed.


Parameters:

string   $identity   —  identity URI
string   $service   —  service URI
string   $microID   —  existing MicroID to test against

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:19:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.