Core/CafeLib.Core.Numerics/UInt256.cs
/// <summary>
/// Creates a UInt256 object from hex string.
/// </summary>
/// <param name="hex">hex string</param>
/// <param name="littleEndian">assign bytes from lowest to highest numeric position</param>
/// <returns>UInt256 object</returns>
/// <remarks>Default behavior assigns bytes from highest to lowest numeric position</remarks>
Creates a UInt256 object from hex string.
Creates a UInt256 object from hex string .
public static UInt256 FromHex(string hex, bool littleEndian = false)
        {
            if (string.IsNullOrWhiteSpace(hex)) return new UInt256();
            var result = new UInt256(littleEndian);
            (littleEndian ? Encoders.Hex : Encoders.HexReverse).TryDecodeSpan(hex, result.Span);
            return result;
        }
public static UInt256 FromHex ( string hex , bool littleEndian = false ) { if ( string . IsNullOrWhiteSpace ( hex ) ) return new UInt256 ( ) ; var result = new UInt256 ( littleEndian ) ; ( littleEndian ? Encoders . Hex : Encoders . HexReverse ) . TryDecodeSpan ( hex , result . Span ) ; return result ; }
Creates a UInt256 object from hex string.
Creates a UInt256 object from hex string .
None
hex
string
None
littleEndian
bool
assign bytes from lowest to highest numeric position
assign bytes from lowest to highest numeric position
remarks
Default behavior assigns bytes from highest to lowest numeric position
Default behavior assigns bytes from highest to lowest numeric position