开发者

BigInteger to Hexadecimal

开发者 https://www.devze.com 2023-02-10 20:00 出处:网络
Quick question... I have a stupidly long BigInteger which I would like to write to a file as a hex string.

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


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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号