src/NeinMath/IntegerConverter.cs
/// <summary>
/// Returns the specified Integer as a hex string.
/// </summary>
/// <param name="value">The number to convert.</param>
/// <returns>A hex string.</returns>
Returns the specified Integer as a hex string.
Returns the specified Integer as a hex string .
public static string ToHexString(this Integer value)
        {
            var bytes = ToByteArray(value);
            var digits = new string[bytes.Length];
            for (var i = 0; i < bytes.Length; i++)
                digits[i] = bytes[bytes.Length - i - 1].ToString("X2",
                    CultureInfo.InvariantCulture);
            var trivialSign = (digits[0][0] == '0' && digits[0][1] < '8')
                || (digits[0][0] == 'F' && digits[0][1] >= '8');
            if (trivialSign)
                digits[0] = digits[0].Substring(1);
            return string.Concat(digits);
        }
public static string ToHexString ( this Integer value ) { var bytes = ToByteArray ( value ) ; var digits = new string [ bytes . Length ] ; for ( var i = 0 ; i < bytes . Length ; i ++ ) digits [ i ] = bytes [ bytes . Length - i - 1 ] . ToString ( " " , CultureInfo . InvariantCulture ) ; var trivialSign = ( digits [ 0 ] [ 0 ] == ' ' && digits [ 0 ] [ 1 ] < ' ' ) || ( digits [ 0 ] [ 0 ] == ' ' && digits [ 0 ] [ 1 ] >= ' ' ) ; if ( trivialSign ) digits [ 0 ] = digits [ 0 ] . Substring ( 1 ) ; return string . Concat ( digits ) ; }
Returns the specified Integer as a hex string.
Returns the specified Integer as a hex string .
A hex string.
A hex string .
Integer
this
value
The number to convert.
The number to convert .