Skip to content

Instantly share code, notes, and snippets.

@tiraeth
Created July 15, 2013 16:25
Show Gist options
  • Save tiraeth/6001337 to your computer and use it in GitHub Desktop.
Save tiraeth/6001337 to your computer and use it in GitHub Desktop.
<?php
function mbank_zakoduj_haslo($haslo)
{
$mapa = array(
'a' => 'n',
'b' => 'o',
'c' => 'p',
'd' => 'q',
'e' => 'r',
'f' => 's',
'g' => 't',
'h' => 'u',
'i' => 'v',
'j' => 'w',
'k' => 'x',
'l' => 'y',
'm' => 'z',
'n' => '1',
'o' => '2',
'p' => '3',
'q' => '4',
'r' => '5',
's' => '6',
't' => '7',
'u' => '8',
'v' => '9',
'w' => '0',
'x' => 'a',
'y' => 'b',
'z' => 'c',
'1' => 'd',
'2' => 'e',
'3' => 'f',
'4' => 'g',
'5' => 'h',
'6' => 'i',
'7' => 'j',
'8' => 'k',
'9' => 'l',
'0' => 'm',
);
for($i=0; $i<strlen($haslo); $i++)
{
if (!isset($mapa[$haslo[$i]])) {
trigger_error('W Twoim haśle znajduje się znak niedozwolony.', E_USER_ERROR);
}
$haslo[$i] = $mapa[$haslo[$i]];
}
return $haslo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment