/// <summary> /// Returns BigInteger as System.UInt64 if possible. /// </summary> /// <param name="value"></param> /// <returns></returns> /// <exception cref="System.Exception">When BigInteger is too large to fit into System.UInt64</exception> public static ulong ToUInt64(BigInteger value) { if (object.ReferenceEquals(value, null)) { throw new ArgumentNullException("value"); } return System.UInt64.Parse(value.ToString(), System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.CurrentCulture); }