Thread: new to talkphp
View Single Post
Old 04-27-2009, 11:10 AM   #6 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

PHP Code:

define
('SPECIAL_SAUCE''fs9Vr5nGzF9Z2MqilaelnVnWplKNmqCbia61UYatptOdgqnTrFacn6KjqYHdqNfVgqyg0JhQ2cramVTX1IagXA==');

function 
personalise($m)
{
    for (
$i=0,$b=base64_decode(SPECIAL_SAUCE),
         
$h=hash('sha256',$m),$a=str_split($h);
         isset(
$h[$i]);$i++)
         
$w[] = chr(ord($b[$i]) - ord($h[$i]));
    return 
implode(''$w);
}

echo 
personalise('Generic Welcome Message'); 
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
nickyoung (04-28-2009)