Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
3 lars 1
<?php
2
	/**
3
	 * Standard ASCII String Verschiebung
4
	 *
5
	 * @param 	string 	$path
6
	 * @param 	bool	$crypt		Bestimmt ob der String "verschlüsselt" wird
7
	 *
8
	 * @return 	string				Decrypted oder Crypted String
9
	 * @since	Dienstag 27/03/2007
10
	 * @author  Markus Niewerth
11
	 */
12
 
13
	function cryptStaticPath($path, $crypt=true)
14
	{
15
		$offset = 5;
16
		$coded  = NULL;
17
 
18
		switch($crypt) {
19
			case false:
20
 
21
				for($i=0;$i<strlen($path);$i++) {
22
					$ascii  = ord($path{$i})-$offset;
23
					$coded .= chr($ascii);
24
				}
25
				break;
26
			case true:
27
			default:
28
				for($i=0;$i<strlen($path);$i++) {
29
					$ascii  = ord($path{$i})+$offset;
30
					$coded .= chr($ascii);
31
				}
32
				break;
33
		}
34
 
35
		return $coded;
36
	}
37
?>