contributions/usermanagement/lib/interfaces/ihash.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Interface for Hash algorithm implementations 00004 * 00005 * @since 0.5.1 00006 * 00007 * Hash algorithzm implementations must be placed beneath /behaviour/comands/users/hashes/ and 00008 * named [algo].hash.php, where [algo] is the name of the algorithm. The class itself is 00009 * named [Algo]Hash. 00010 * 00011 * For example the md5 algorithm's file is named /behaviour/commands/users/hashes/md5.hash.php and 00012 * contains the class Md5Hash. 00013 * 00014 * @attention Algorithm names are limited to 5 characters! 00015 * 00016 * @author Gerd Riesselmann 00017 * @ingroup Usermanagement 00018 */ 00019 interface IHashAlgorithm { 00020 /** 00021 * Create hash 00022 * 00023 * @param string $source 00024 * @return string 00025 */ 00026 public function hash($source); 00027 00028 /** 00029 * Validate if given hash matches source 00030 * 00031 * @param string $source 00032 * @param string $hash 00033 * @return bool 00034 */ 00035 public function check($source, $hash); 00036 }