我正在尝试反向工程一些Javascript代码,并用PHP重新编码。有一个用parseInt( String,36)“转换”成整数的字符串。我需要一个可能性将整数转换回PHP中的秘密字符串,而不知道秘密字符串。
secretCode = "0vo8fz4kvy03";
decode = parseInt(secretCode, 36).toString();
console.log(decode); //= 115802171408044510
我如何在PHP中做到这一点?115802171408044510返回到0vo8fz4kvy03
这个整数包含一些信息:
decode="115802171408044510";
storeID = decode.substr(0, 4); // 1158
posID = decode.substr(12, 2); // 04
orderID = decode.substr(14, 2); // 45
day = decode.substr(6, 2); // 17
month = decode.substr(4, 2); // 02
hour = decode.substr(8, 2); // 14
minutes = decode.substr(10, 2); // 08我想编辑上面的值并将其转换回"secretCode“字符串。他们正以某种方式在服务器端做到这一点。
发布于 2019-06-02 00:07:05
要将javascript编码的数字字符串从基数10转换为基数36,请执行以下操作:
$decode = "115802171408044510";
echo base_convert ( $decode , 10 , 36 );发布于 2019-06-01 23:55:31
你不能。数字溢出了最大的安全整数大小,因此不可能逆转这个过程(因为数字被四舍五入到下一个安全整数)。因此,代码被破坏了。
发布于 2019-06-01 23:47:39
You can try.
decode.toString(36)https://stackoverflow.com/questions/56408128
复制相似问题