parse_alpha.php
<?php
 
$input = $argv[1];
 
$start = strpos($input, '1010001'); /* Start Sentinel */
$to_parse = substr($input, $start); // strip leading zeros
$byte = 0x0;
 
$pos = 0;
$end_sentinel = false;
 
while ($pos < strlen($to_parse)) {
    $byte = bindec(strrev(substr($to_parse, $pos, 7)));
 
    $byte &= 0x3f;
    $byte += 0x20;
 
    echo chr($byte);
 
    if ($end_sentinel) {
        break;
    }
    if (chr($byte) == '?') { /* End Sentinel */
        $end_sentinel = true;
    }
    $pos += 7;
}
 
echo "\n";
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki