字符串"-7959620796447070309",转成16进制 字符串输出。
字符串"-7959620796447070309",转成16进制 字符串输出。本来是python的代码 ,我要弄成C++的python代码:
def get_salt(salt):
int_salt = int(salt)
int_salt = (int_salt & 0xffffffffffffffff)
salt = hex(int(int_salt)).lstrip("0x")
salt = salt.rstrip('L')
return salt
salt = get_salt("-7959620796447070309")
输出salt = "9189bf0eb8f5e79b";
hackbs hackbs
发帖于 1分钟前
0回/0阅
标签: <无>
#include <iostream>
using namespace std;
int main()
{
long long salt=-7959620796447070309;
cout<<"salt="<<hex<<salt<<endl;
system("pause");
return 0;
}
页:
[1]