- chr: documentation ( source)
- ord: documentation ( source)
- random_bytes: documentation ( source)
<?php
$str = random_bytes(13);
$decoded = '';
$letterRange = (ord('a')-ord('Z'));
for($i = 0; $i < strlen($str); $i++)
{
$decoded .= chr(ord($str[$i])%$letterRange + ord('a'));
}
echo $str.'|'.$decoded;