Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基于这个公式$tag= pack("H*",dechex(1146046298));输出是 DOGZ
$tag= pack("H*",dechex(1146046298));
现在我需要那个公式的反面。一旦我输入 DOGZ,输出必须是 1146046298
解码顺序:先dechex,后pack。与此相反的是首先unpack,然后hexdec... 先生,我已经这样做了 >>> unpack("H*",hexdec('DOGZ')); 还是行不通
解码顺序:先dechex,后pack。与此相反的是首先unpack,然后hexdec...
dechex
pack
unpack
hexdec
先生,我已经这样做了 >>> unpack("H*",hexdec('DOGZ')); 还是行不通
不,相反的pack('H*', dechex(1146046298))是hexdec(unpack('H*', 'DOGZ'))。而且由于unpack结果是一个数组,因此您还需要从数组中获取值。所以:
pack('H*', dechex(1146046298))
hexdec(unpack('H*', 'DOGZ'))
hexdec(current(unpack('H*', 'DOGZ')))