我会使用System.Numerics.BigInteger类来执行此操作.确切的解决方案取决于您具有此数字的格式:字符串,双精度,其他.
如果string(s):
var bigInt = BigInteger.Parse(s);
var hexString = bigInt.ToString("x");
Run Code Online (Sandbox Code Playgroud)
如果是double(d):
var bigInt = new BigInteger(d);
var hexString = bigInt.ToString("x");
Run Code Online (Sandbox Code Playgroud)
......等等.