BigInteger to Hexadecimal

biginteger, c#, hex

Solution

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

Problem

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

Original source

Related problems