/Library/Kumbia/Filter/BaseFilters/Md5.php
PHP | 54 lines | 10 code | 4 blank | 40 comment | 2 complexity | 80e9d14643366fdbec1b80a4059efa64 MD5 | raw file
- <?php
- /**
- * Kumbia Enterprise Framework
- *
- * LICENSE
- *
- * This source file is subject to the New BSD License that is bundled
- * with this package in the file docs/LICENSE.txt.
- *
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@loudertechnology.com so we can send you a copy immediately.
- *
- * @category Kumbia
- * @package Filter
- * @subpackage BaseFilters
- * @copyright Copyright (c) 2008-2010 Louder Technology COL. (http://www.loudertechnology.com)
- * @copyright Copyright (c) 2007-2009 Andres Felipe Gutierrez (gutierrezandresfelipe at gmail.com)
- * @copyright Copyright (c) 2007-2007 Emilio Rafael Silveira Tovar(emilio.rst at gmail.com)
- * @copyright Copyright (c) 2007-2007 Deivinson Tejeda Brito (deivinsontejeda at gmail.com)
- * @license New BSD License
- * @version $Id: Md5.php 148 2010-04-20 22:17:31Z gutierrezandresfelipe $
- */
- /**
- * Md5Filter
- *
- * Convierte una cadena a un string MD5
- *
- * @category Kumbia
- * @package Filter
- * @subpackage BaseFilters
- * @copyright Copyright (c) 2008-2010 Louder Technology COL. (http://www.loudertechnology.com)
- * @copyright Copyright (c) 2007-2008 Andres Felipe Gutierrez (gutierrezandresfelipe at gmail.com)
- * @license New BSD License
- */
- class Md5Filter implements FilterInterface {
- /**
- * Ejecuta el filtro
- *
- * @param string $s
- * @return int
- */
- public function execute($s){
- if(strlen($s)==32){
- return preg_replace('/[^a-fA-F0-9]/', '', $s);
- } else {
- return null;
- }
- }
- }