BigInteger to Hexadecimal

只愿长相守 提交于 2019-12-05 18:16:18

问题


Quick question...

I have a stupidly long BigInteger which I would like to write to a file as a hex string.

I know Java provides the .toString(16) method which does this, but I can't find an equivalent in C#.

I'm using System.Numerics.BigInteger from .NET 4.0.

Thanks


回答1:


Use .ToString("X") or .ToString("x") depending on what case you prefer.




回答2:


Can you not use yourBI.ToString("X")?

http://msdn.microsoft.com/en-us/library/dd268260.aspx



来源:https://stackoverflow.com/questions/4988858/biginteger-to-hexadecimal

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!