-
Notifications
You must be signed in to change notification settings - Fork 1
/
ppp-rev.php
29 lines (28 loc) · 919 Bytes
/
ppp-rev.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require('bigint.php');
header("Content-Type: text/plain");
$ppp="L:k66XiKLeiPMYxf8H!5%%!";
$set="!#%+23456789:=?@ABCDEFGHJKLMNPRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; //character set
//make set and ppp into array
$seta=str_split($set);
$pppa=str_split($ppp);
//get number array
$char=array_pop($pppa);
while($char!==null) {
$charna[]=array_search($char,$seta);
$char=array_pop($pppa);
}
//var_dump($charna); //throw the array
$num=new Math_BigInteger(array_shift($charna));
$charn=array_shift($charna);
while($charn!==null) {
//bla=bla*set
//bla+next
//bla+(setxnext)
echo "prev: ".$num->toString()." Setcount: ".count($seta)." Remainder (from PPP): ".$charn."\n";
$num=$num->multiply(new Math_BigInteger(count($seta)));
$num=$num->add(new Math_BigInteger($charn));
$charn=array_shift($charna);
}
echo "\n\n"."Final Number: ".$num->toString().' Hex: '.$num->toHex();
?>