{"id":177,"date":"2020-08-11T02:59:27","date_gmt":"2020-08-11T02:59:27","guid":{"rendered":"https:\/\/michaeljohnsteiner.com\/?p=177"},"modified":"2021-06-12T03:07:45","modified_gmt":"2021-06-12T03:07:45","slug":"int512-cs","status":"publish","type":"post","link":"https:\/\/michaeljohnsteiner.com\/index.php\/2020\/08\/11\/int512-cs\/","title":{"rendered":"(Obsolete) Int512.cs"},"content":{"rendered":"\n<p>Int512 Bit Class<\/p>\n\n\n\n<p>Jun-11,2021: Obsolete Use xIntX Instead.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">using System;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Numerics;\nusing System.Runtime.InteropServices;\nusing System.Text;\n[Serializable]\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\n[TypeConverter(typeof(Int512Converter))]\n[DebuggerDisplay(\"{DDisplay}\")]\npublic struct Int512 : IComparable&lt;Int512>, IComparable, IEquatable&lt;Int512>, IConvertible, IFormattable\n{\n    private ulong B512;\n    private ulong B448;\n    private ulong B384;\n    private ulong B320;\n    private ulong B256;\n    private ulong B192;\n    private ulong B128;\n    private ulong B64;\n    [DebuggerBrowsable(DebuggerBrowsableState.Never)]\n    private string DDisplay => ToString();\n    public static Int512 Zero     = new Int512(0);\n    public static Int512 Ten      = new Int512(10);\n    public static Int512 One      = new Int512(1);\n    public static Int512 MaxValue = GetMaxValue();\n    public static Int512 MinValue = GetMinValue();\n    private const ulong  HiNeg    = 0x8000000000000000;\n    private static Int512 GetMaxValue()\n    {\n        return new Int512(long.MaxValue, ulong.MaxValue, ulong.MaxValue, ulong.MaxValue, ulong.MaxValue, ulong.MaxValue, ulong.MaxValue, ulong.MaxValue);\n    }\n    private static Int512 GetMinValue()\n    {\n        return -GetMaxValue();\n    }\n    public Int512(Int512 value)\n    {\n        B512 = value.B512;\n        B448 = value.B448;\n        B384 = value.B384;\n        B320 = value.B320;\n        B256 = value.B256;\n        B192 = value.B192;\n        B128 = value.B128;\n        B64  = value.B64;\n    }\n    public Int512(string value)\n    {\n        if (!TryParse(value, out var result))\n            throw new Exception(\"TryParse Failed.\");\n        B512 = result.B512;\n        B448 = result.B448;\n        B384 = result.B384;\n        B320 = result.B320;\n        B256 = result.B256;\n        B192 = result.B192;\n        B128 = result.B128;\n        B64  = result.B64;\n    }\n    public Int512(byte value)\n    {\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = value;\n    }\n    public Int512(bool value)\n    {\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = (ulong) (value ? 1 : 0);\n    }\n    public Int512(char value)\n    {\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = value;\n    }\n    public Int512(BigDecimal value)\n    {\n        var ba = value.UnscaledValue.ToByteArray();\n        B512 = BitConverter.ToUInt64(ba, 56);\n        B448 = BitConverter.ToUInt64(ba, 48);\n        B384 = BitConverter.ToUInt64(ba, 40);\n        B320 = BitConverter.ToUInt64(ba, 32);\n        B256 = BitConverter.ToUInt64(ba, 24);\n        B192 = BitConverter.ToUInt64(ba, 16);\n        B128 = BitConverter.ToUInt64(ba, 8);\n        B64  = BitConverter.ToUInt64(ba, 0);\n    }\n    public Int512(decimal value)\n    {\n        if (value &lt; 0)\n        {\n            var n = -new Int512(-value);\n            B512 = n.B512;\n            B448 = n.B448;\n            B384 = n.B384;\n            B320 = n.B320;\n            B256 = n.B256;\n            B192 = n.B192;\n            B128 = n.B128;\n            B64  = n.B64;\n            return;\n        }\n        var bits = decimal.GetBits(value);\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = (uint) bits[2];\n        B128 = (uint) bits[1];\n        B64  = (uint) bits[0];\n    }\n    public Int512(double value) : this((decimal) value)\n    {\n    }\n    public Int512(float value) : this((decimal) value)\n    {\n    }\n    public Int512(short value)\n    {\n        if (value &lt; 0)\n        {\n            var n = -new Int512(-(value + 1)) - 1;\n            B512 = n.B512;\n            B448 = n.B448;\n            B384 = n.B384;\n            B320 = n.B320;\n            B256 = n.B256;\n            B192 = n.B192;\n            B128 = n.B128;\n            B64  = n.B64;\n            return;\n        }\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = (ulong) value;\n    }\n    public Int512(int value)\n    {\n        if (value &lt; 0)\n        {\n            var n = -new Int512(-(value + 1)) - 1;\n            B512 = n.B512;\n            B448 = n.B448;\n            B384 = n.B384;\n            B320 = n.B320;\n            B256 = n.B256;\n            B192 = n.B192;\n            B128 = n.B128;\n            B64  = n.B64;\n            return;\n        }\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = (ulong) value;\n    }\n    public Int512(long value)\n    {\n        if (value &lt; 0)\n        {\n            var n = -new Int512(-(value + 1)) - 1;\n            B512 = n.B512;\n            B448 = n.B448;\n            B384 = n.B384;\n            B320 = n.B320;\n            B256 = n.B256;\n            B192 = n.B192;\n            B128 = n.B128;\n            B64  = n.B64;\n            return;\n        }\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = (ulong) value;\n    }\n    public Int512(sbyte value)\n    {\n        if (value &lt; 0)\n        {\n            var n = -new Int512(-(value + 1)) - 1;\n            B512 = n.B512;\n            B448 = n.B448;\n            B384 = n.B384;\n            B320 = n.B320;\n            B256 = n.B256;\n            B192 = n.B192;\n            B128 = n.B128;\n            B64  = n.B64;\n            return;\n        }\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = (ulong) value;\n    }\n    public Int512(ushort value)\n    {\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = value;\n    }\n    public Int512(uint value)\n    {\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = value;\n    }\n    public Int512(ulong value)\n    {\n        B512 = 0;\n        B448 = 0;\n        B384 = 0;\n        B320 = 0;\n        B256 = 0;\n        B192 = 0;\n        B128 = 0;\n        B64  = value;\n    }\n    public Int512(BigInteger value) : this(value.ToByteArray())\n    {\n        var aba = MaxValue.ToByteArray();\n        var bn  = new BigInteger(aba);\n    }\n    public Int512(Guid value) : this(value.ToByteArray())\n    {\n    }\n    public Int512(byte[] value)\n    {\n        if (value == null)\n            throw new Exception(\"Value cannot be null.\");\n        if (value.Length != 64)\n            Array.Resize(ref value, 64);\n        B512 = BitConverter.ToUInt64(value, 56);\n        B448 = BitConverter.ToUInt64(value, 48);\n        B384 = BitConverter.ToUInt64(value, 40);\n        B320 = BitConverter.ToUInt64(value, 32);\n        B256 = BitConverter.ToUInt64(value, 24);\n        B192 = BitConverter.ToUInt64(value, 16);\n        B128 = BitConverter.ToUInt64(value, 8);\n        B64  = BitConverter.ToUInt64(value, 0);\n    }\n    public Int512(ulong b512, ulong b448, ulong b384, ulong b320, ulong b256, ulong b192, ulong b128, ulong b64)\n    {\n        B512 = b512;\n        B448 = b448;\n        B384 = b384;\n        B320 = b320;\n        B256 = b256;\n        B192 = b192;\n        B128 = b128;\n        B64  = b64;\n    }\n    public Int512(int sign, uint[] array)\n    {\n        if (array == null)\n            throw new Exception(\"Array cannot be null.\");\n        var b512 = new byte[8];\n        var b448 = new byte[8];\n        var b384 = new byte[8];\n        var b320 = new byte[8];\n        var b256 = new byte[8];\n        var b192 = new byte[8];\n        var b128 = new byte[8];\n        var b64  = new byte[8];\n        if (array.Length > 0)\n        {\n            Array.Copy(BitConverter.GetBytes(array[0]), 0, b64, 0, 4);\n            if (array.Length > 1)\n            {\n                Array.Copy(BitConverter.GetBytes(array[1]), 0, b64, 4, 4);\n                if (array.Length > 2)\n                {\n                    Array.Copy(BitConverter.GetBytes(array[2]), 0, b128, 0, 4);\n                    if (array.Length > 3)\n                    {\n                        Array.Copy(BitConverter.GetBytes(array[3]), 0, b128, 4, 4);\n                        if (array.Length > 4)\n                        {\n                            Array.Copy(BitConverter.GetBytes(array[4]), 0, b192, 0, 4);\n                            if (array.Length > 5)\n                            {\n                                Array.Copy(BitConverter.GetBytes(array[5]), 0, b192, 4, 4);\n                                if (array.Length > 6)\n                                {\n                                    Array.Copy(BitConverter.GetBytes(array[6]), 0, b256, 0, 4);\n                                    if (array.Length > 7)\n                                    {\n                                        Array.Copy(BitConverter.GetBytes(array[7]), 0, b256, 4, 4);\n                                        if (array.Length > 8)\n                                        {\n                                            Array.Copy(BitConverter.GetBytes(array[8]), 0, b320, 0, 4);\n                                            if (array.Length > 9)\n                                            {\n                                                Array.Copy(BitConverter.GetBytes(array[9]), 0, b320, 4, 4);\n                                                if (array.Length > 10)\n                                                {\n                                                    Array.Copy(BitConverter.GetBytes(array[10]), 0, b384, 0, 4);\n                                                    if (array.Length > 11)\n                                                    {\n                                                        Array.Copy(BitConverter.GetBytes(array[11]), 0, b384, 4, 4);\n                                                        if (array.Length > 12)\n                                                        {\n                                                            Array.Copy(BitConverter.GetBytes(array[12]), 0, b448, 0, 4);\n                                                            if (array.Length > 13)\n                                                            {\n                                                                Array.Copy(BitConverter.GetBytes(array[13]), 0, b448, 4, 4);\n                                                                if (array.Length > 14)\n                                                                {\n                                                                    Array.Copy(BitConverter.GetBytes(array[14]), 0, b512, 0, 4);\n                                                                    if (array.Length > 15)\n                                                                        Array.Copy(BitConverter.GetBytes(array[15]), 0, b512, 4, 4);\n                                                                }\n                                                            }\n                                                        }\n                                                    }\n                                                }\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        B512 = BitConverter.ToUInt64(b512, 0);\n        B448 = BitConverter.ToUInt64(b448, 0);\n        B384 = BitConverter.ToUInt64(b384, 0);\n        B320 = BitConverter.ToUInt64(b320, 0);\n        B256 = BitConverter.ToUInt64(b256, 0);\n        B192 = BitConverter.ToUInt64(b192, 0);\n        B128 = BitConverter.ToUInt64(b128, 0);\n        B64  = BitConverter.ToUInt64(b64,  0);\n        if (sign &lt; 0)\n            B512 |= HiNeg;\n        else\n            B512 &amp;= ~HiNeg;\n    }\n    public int BitWidth\n    {\n        get\n        {\n            Int512 bitWidth = 1;\n            var    v        = this;\n            while ((v >>= 1) > 0)\n                bitWidth++;\n            if (bitWidth &lt; 8)\n                bitWidth = 8;\n            while (bitWidth % 8 != 0)\n                bitWidth++;\n            return (int) bitWidth;\n        }\n    }\n    public int Sign\n    {\n        get\n        {\n            var allZero = true;\n            var ba      = ToUIn32Array();\n            for (var i = 0; i &lt; ba.Length; i++)\n                if (ba[i] != 0)\n                {\n                    allZero = false;\n                    break;\n                }\n            if (allZero)\n                return 0;\n            return (B512 &amp; HiNeg) == 0 ? 1 : -1;\n        }\n    }\n    public bool IsOne      => this     == One;\n    public bool IsEven     => this % 2 == 0;\n    public bool IsNegative => Sign     &lt; 0;\n    public bool IsZero     => B512 == 0 &amp;&amp; B448 == 0 &amp;&amp; B384 == 0 &amp;&amp; B320 == 0 &amp;&amp; B256 == 0 &amp;&amp; B192 == 0 &amp;&amp; B128 == 0 &amp;&amp; B64 == 0;\n    public override int GetHashCode()\n    {\n        return B64.GetHashCode() ^ B128.GetHashCode() ^ B192.GetHashCode() ^ B256.GetHashCode() ^ B320.GetHashCode() ^ B384.GetHashCode() ^ B448.GetHashCode() ^ B512.GetHashCode();\n    }\n    public override bool Equals(object obj)\n    {\n        return base.Equals(obj);\n    }\n    public bool Equals(Int512 obj)\n    {\n        return B512 == obj.B512 &amp;&amp; B448 == obj.B448 &amp;&amp; B384 == obj.B384 &amp;&amp; B320 == obj.B320 &amp;&amp; B256 == obj.B256 &amp;&amp; B192 == obj.B192 &amp;&amp; B128 == obj.B128 &amp;&amp; B64 == obj.B64;\n    }\n    public override string ToString()\n    {\n        return ToString(null, null);\n    }\n    public string ToString(string format)\n    {\n        return ToString(format, null);\n    }\n    public string ToString(string format, IFormatProvider formatProvider)\n    {\n        if (formatProvider == null)\n            formatProvider = CultureInfo.CurrentCulture;\n        if (!string.IsNullOrEmpty(format))\n        {\n            var ch = format[0];\n            if (ch == 'x' || ch == 'X')\n            {\n                int.TryParse(format.Substring(1).Trim(), out var min);\n                return ToHexString(ch == 'X', min);\n            }\n            if (ch != 'G' &amp;&amp; ch != 'g' &amp;&amp; ch != 'D' &amp;&amp; ch != 'd')\n                throw new NotSupportedException(\"Not supported format: \" + format);\n        }\n        return ToString((NumberFormatInfo) formatProvider.GetFormat(typeof(NumberFormatInfo)), 10);\n    }\n    private string ToHexString(bool caps, int min)\n    {\n        var bytes = ToByteArray().Invert();\n        var sb    = new StringBuilder();\n        var x     = caps ? \"X\" : \"x\";\n        foreach (var b in bytes)\n        {\n            var hex = b.ToString($\"{x}2\");\n            sb.Append(hex);\n        }\n        return sb.ToString();\n    }\n    private string ToString(NumberFormatInfo info, int radix)\n    {\n        if (radix &lt; 2 || radix > 36)\n            throw new ArgumentOutOfRangeException(\"radix\");\n        if (Sign == 0)\n            return \"0\";\n        var          negative = Sign &lt; 0;\n        var          a        = negative ? Abs(this) : this;\n        var          biRadix  = new Int512(radix);\n        const string charSet  = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n        var          al       = new ArrayList();\n        while (a.Sign != 0 &amp;&amp; a.B64 != 0)\n        {\n            Divide(a, biRadix, out var remainder, out var quotient);\n            al.Insert(0, charSet[(int) remainder.B64]);\n            a = quotient;\n        }\n        var result = new string((char[]) al.ToArray(typeof(char)));\n        if (radix == 10 &amp;&amp; negative)\n            return \"-\" + result;\n        return result;\n    }\n    public static Int512 Abs(Int512 value)\n    {\n        if (ReferenceEquals(value, null))\n            throw new ArgumentNullException(\"value\");\n        if (value.Sign &lt; 0)\n            return -value;\n        return value;\n    }\n    TypeCode IConvertible.GetTypeCode()\n    {\n        return TypeCode.Object;\n    }\n    bool IConvertible.ToBoolean(IFormatProvider provider)\n    {\n        return (bool) this;\n    }\n    byte IConvertible.ToByte(IFormatProvider provider)\n    {\n        return (byte) this;\n    }\n    char IConvertible.ToChar(IFormatProvider provider)\n    {\n        return (char) this;\n    }\n    DateTime IConvertible.ToDateTime(IFormatProvider provider)\n    {\n        throw new InvalidCastException();\n    }\n    decimal IConvertible.ToDecimal(IFormatProvider provider)\n    {\n        return (decimal) this;\n    }\n    double IConvertible.ToDouble(IFormatProvider provider)\n    {\n        return (double) this;\n    }\n    short IConvertible.ToInt16(IFormatProvider provider)\n    {\n        return (short) this;\n    }\n    int IConvertible.ToInt32(IFormatProvider provider)\n    {\n        return (int) this;\n    }\n    long IConvertible.ToInt64(IFormatProvider provider)\n    {\n        return (int) this;\n    }\n    sbyte IConvertible.ToSByte(IFormatProvider provider)\n    {\n        return (sbyte) this;\n    }\n    float IConvertible.ToSingle(IFormatProvider provider)\n    {\n        return (float) this;\n    }\n    string IConvertible.ToString(IFormatProvider provider)\n    {\n        return ToString(null, provider);\n    }\n    public bool TryConvert(Type conversionType, IFormatProvider provider, out object value)\n    {\n        if (conversionType == typeof(bool))\n        {\n            value = (bool) this;\n            return true;\n        }\n        if (conversionType == typeof(byte))\n        {\n            value = (byte) this;\n            return true;\n        }\n        if (conversionType == typeof(char))\n        {\n            value = (char) this;\n            return true;\n        }\n        if (conversionType == typeof(decimal))\n        {\n            value = (decimal) this;\n            return true;\n        }\n        if (conversionType == typeof(double))\n        {\n            value = (double) this;\n            return true;\n        }\n        if (conversionType == typeof(short))\n        {\n            value = (short) this;\n            return true;\n        }\n        if (conversionType == typeof(int))\n        {\n            value = (int) this;\n            return true;\n        }\n        if (conversionType == typeof(long))\n        {\n            value = (long) this;\n            return true;\n        }\n        if (conversionType == typeof(sbyte))\n        {\n            value = (sbyte) this;\n            return true;\n        }\n        if (conversionType == typeof(float))\n        {\n            value = (float) this;\n            return true;\n        }\n        if (conversionType == typeof(string))\n        {\n            value = ToString(null, provider);\n            return true;\n        }\n        if (conversionType == typeof(ushort))\n        {\n            value = (ushort) this;\n            return true;\n        }\n        if (conversionType == typeof(uint))\n        {\n            value = (uint) this;\n            return true;\n        }\n        if (conversionType == typeof(ulong))\n        {\n            value = (ulong) this;\n            return true;\n        }\n        if (conversionType == typeof(byte[]))\n        {\n            value = ToByteArray();\n            return true;\n        }\n        if (conversionType == typeof(Guid))\n        {\n            value = new Guid(ToByteArray());\n            return true;\n        }\n        value = null;\n        return false;\n    }\n    public static Int512 Parse(string value)\n    {\n        return Parse(value, NumberStyles.Integer, NumberFormatInfo.CurrentInfo);\n    }\n    public static Int512 Parse(string value, NumberStyles style)\n    {\n        return Parse(value, style, NumberFormatInfo.CurrentInfo);\n    }\n    public static Int512 Parse(string value, IFormatProvider provider)\n    {\n        return Parse(value, NumberStyles.Integer, NumberFormatInfo.GetInstance(provider));\n    }\n    public static Int512 Parse(string value, NumberStyles style, IFormatProvider provider)\n    {\n        if (!TryParse(value, style, provider, out var result))\n            throw new Exception($\"TryParse value {value} failure.\");\n        return result;\n    }\n    public static bool TryParse(string value, out Int512 result)\n    {\n        return TryParse(value, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result);\n    }\n    public static bool TryParse(string value, NumberStyles style, IFormatProvider provider, out Int512 result)\n    {\n        result = Zero;\n        if (string.IsNullOrEmpty(value))\n            return false;\n        if (value.StartsWith(\"x\", StringComparison.OrdinalIgnoreCase))\n        {\n            style |= NumberStyles.AllowHexSpecifier;\n            value =  value.Substring(1);\n        }\n        else\n        {\n            if (value.StartsWith(\"0x\", StringComparison.OrdinalIgnoreCase))\n            {\n                style |= NumberStyles.AllowHexSpecifier;\n                value =  value.Substring(2);\n            }\n        }\n        if ((style &amp; NumberStyles.AllowHexSpecifier) == NumberStyles.AllowHexSpecifier)\n            return TryParseNum(value, 16, out result);\n        return TryParseNum(value, 10, out result);\n    }\n    public static bool TryParseNum(string digits, int radix, out Int512 result)\n    {\n        result = new Int512();\n        if (digits == null)\n            return false;\n        var multiplier = new Int512(1);\n        digits = digits.ToUpper(CultureInfo.CurrentCulture).Trim();\n        var nDigits = digits[0] == '-' ? 1 : 0;\n        for (var idx = digits.Length - 1; idx >= nDigits; idx--)\n        {\n            var d = (int) digits[idx];\n            if (d >= '0' &amp;&amp; d &lt;= '9')\n                d -= '0';\n            else if (d >= 'A' &amp;&amp; d &lt;= 'Z')\n                d = d - 'A' + 10;\n            else\n                return false;\n            if (d >= radix)\n                return false;\n            result     += multiplier * d;\n            multiplier *= radix;\n        }\n        if (digits[0] == '-')\n            result = -result;\n        return true;\n    }\n    public object ToType(Type conversionType, IFormatProvider provider)\n    {\n        object value;\n        if (TryConvert(conversionType, provider, out value))\n            return value;\n        throw new InvalidCastException();\n    }\n    ushort IConvertible.ToUInt16(IFormatProvider provider)\n    {\n        if (B128 != 0)\n            throw new OverflowException();\n        return Convert.ToUInt16(B64);\n    }\n    uint IConvertible.ToUInt32(IFormatProvider provider)\n    {\n        if (B128 != 0)\n            throw new OverflowException();\n        return Convert.ToUInt32(B64);\n    }\n    ulong IConvertible.ToUInt64(IFormatProvider provider)\n    {\n        if (B128 != 0)\n            throw new OverflowException();\n        return B64;\n    }\n    int IComparable.CompareTo(object obj)\n    {\n        return Compare(this, obj);\n    }\n    public static int Compare(Int512 left, object right)\n    {\n        if (right is Int512)\n            return Compare(left, (Int512) right);\n        if (right is bool)\n            return Compare(left, new Int512((bool) right));\n        if (right is byte)\n            return Compare(left, new Int512((byte) right));\n        if (right is char)\n            return Compare(left, new Int512((char) right));\n        if (right is decimal)\n            return Compare(left, new Int512((decimal) right));\n        if (right is double)\n            return Compare(left, new Int512((double) right));\n        if (right is short)\n            return Compare(left, new Int512((short) right));\n        if (right is int)\n            return Compare(left, new Int512((int) right));\n        if (right is long)\n            return Compare(left, new Int512((long) right));\n        if (right is sbyte)\n            return Compare(left, new Int512((sbyte) right));\n        if (right is float)\n            return Compare(left, new Int512((float) right));\n        if (right is ushort)\n            return Compare(left, new Int512((ushort) right));\n        if (right is uint)\n            return Compare(left, new Int512((uint) right));\n        if (right is ulong)\n            return Compare(left, new Int512((ulong) right));\n        var bytes = right as byte[];\n        if (bytes != null &amp;&amp; bytes.Length != 64)\n            return Compare(left, new Int512(bytes));\n        if (right is Guid)\n            return Compare(left, new Int512((Guid) right));\n        throw new ArgumentException();\n    }\n    public static int Compare(Int512 left, Int512 right)\n    {\n        if (ReferenceEquals(left, right))\n            return 0;\n        if (ReferenceEquals(left, null))\n            throw new ArgumentNullException(\"leftSide\");\n        if (ReferenceEquals(right, null))\n            throw new ArgumentNullException(\"rightSide\");\n        if (left > right) return 1;\n        if (left == right) return 0;\n        return -1;\n    }\n    public int CompareTo(Int512 value)\n    {\n        return Compare(this, value);\n    }\n    public static implicit operator Int512(bool value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(byte value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(char value)\n    {\n        return new Int512(value);\n    }\n    public static explicit operator Int512(decimal value)\n    {\n        return new Int512(value);\n    }\n    public static explicit operator Int512(double value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(short value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(int value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(long value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(sbyte value)\n    {\n        return new Int512(value);\n    }\n    public static explicit operator Int512(float value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(ushort value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(uint value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(ulong value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(BigInteger value)\n    {\n        return new Int512(value);\n    }\n    public static implicit operator Int512(BigDecimal value)\n    {\n        return new Int512(value);\n    }\n    public static explicit operator bool(Int512 value)\n    {\n        return (byte) value.B64 != 0;\n    }\n    public static explicit operator byte(Int512 value)\n    {\n        return (byte) value.B64;\n    }\n    public static explicit operator char(Int512 value)\n    {\n        return (char) (ushort) value.B64;\n    }\n    public static explicit operator decimal(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        return new decimal((int) (value.B64 &amp; 0xFFFFFFFF), (int) (value.B64 >> 32), (int) (value.B128 &amp; 0xFFFFFFFF), value.Sign &lt; 0, 0);\n    }\n    public static explicit operator double(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        var nfi = CultureInfo.InvariantCulture.NumberFormat;\n        if (!double.TryParse(value.ToString(nfi, 10), NumberStyles.Number, nfi, out var d))\n            throw new OverflowException();\n        return d;\n    }\n    public static explicit operator float(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        var nfi = CultureInfo.InvariantCulture.NumberFormat;\n        if (!float.TryParse(value.ToString(nfi, 10), NumberStyles.Number, nfi, out var f))\n            throw new OverflowException();\n        return f;\n    }\n    public static explicit operator short(Int512 value)\n    {\n        if (value.B64 > 0x8000)\n            throw new OverflowException();\n        if (value.B64 == 0x8000 &amp;&amp; value.Sign > 0)\n            throw new OverflowException();\n        return (short) ((int) value.B64 * value.Sign);\n    }\n    public static explicit operator int(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        if (value.B64 > 0x80000000)\n            throw new OverflowException();\n        if (value.B64 == 0x80000000 &amp;&amp; value.Sign > 0)\n            throw new OverflowException();\n        return (int) value.B64 * value.Sign;\n    }\n    public static explicit operator long(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        if (value.B64 > long.MaxValue)\n            throw new OverflowException();\n        return (long) value.B64 * value.Sign;\n    }\n    public static explicit operator uint(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        if (value.Sign &lt; 0 || value.B64 > uint.MaxValue)\n            throw new OverflowException();\n        return (uint) value.B64;\n    }\n    public static explicit operator ushort(Int512 value)\n    {\n        if (value.Sign == 0)\n            return 0;\n        if (value.Sign &lt; 0 || value.B64 > ushort.MaxValue)\n            throw new OverflowException();\n        return (ushort) value.B64;\n    }\n    public static explicit operator ulong(Int512 value)\n    {\n        if (value.Sign &lt; 0 || value.B64 != 0)\n            throw new OverflowException();\n        return value.B64;\n    }\n    public static explicit operator BigInteger(Int512 value)\n    {\n        return new BigInteger(value.ToByteArray());\n    }\n    public static bool operator >(Int512 left, Int512 right)\n    {\n        if (ReferenceEquals(left, null))\n            throw new ArgumentNullException(\"left\");\n        if (ReferenceEquals(right, null))\n            throw new ArgumentNullException(\"right\");\n        if (left.Sign != right.Sign)\n            return right.Sign &lt; 0;\n        if (left.B64 != right.B64)\n            return left.B64 > right.B64;\n        if (left.B128 != right.B128)\n            return left.B128 > right.B128;\n        if (left.B192 != right.B192)\n            return left.B192 > right.B192;\n        if (left.B256 != right.B256)\n            return left.B256 > right.B256;\n        if (left.B320 != right.B320)\n            return left.B320 > right.B320;\n        if (left.B384 != right.B384)\n            return left.B384 > right.B384;\n        if (left.B448 != right.B448)\n            return left.B448 > right.B448;\n        if (left.B512 != right.B512)\n            return left.B512 > right.B512;\n        return false;\n    }\n    public static bool operator &lt;(Int512 left, Int512 right)\n    {\n        return Compare(left, right) &lt; 0;\n    }\n    public static bool operator >=(Int512 left, Int512 right)\n    {\n        return Compare(left, right) >= 0;\n    }\n    public static bool operator &lt;=(Int512 left, Int512 right)\n    {\n        return Compare(left, right) &lt;= 0;\n    }\n    public static bool operator !=(Int512 left, Int512 right)\n    {\n        return Compare(left, right) != 0;\n    }\n    public static bool operator ==(Int512 left, Int512 right)\n    {\n        if (ReferenceEquals(left, right))\n            return true;\n        if (ReferenceEquals(left, null) || ReferenceEquals(right, null))\n            return false;\n        if (left.Sign != right.Sign)\n            return false;\n        return left.Equals(right);\n    }\n    public static Int512 operator +(Int512 value)\n    {\n        return value;\n    }\n    public static Int512 operator ~(Int512 value)\n    {\n        return -(value + One);\n    }\n    public static Int512 operator -(Int512 value)\n    {\n        return Negate(value);\n    }\n    public static Int512 operator ++(Int512 value)\n    {\n        return value + 1;\n    }\n    public static Int512 operator --(Int512 value)\n    {\n        return value - 1;\n    }\n    public static Int512 Negate(Int512 value)\n    {\n        return new Int512(~value.B512, ~value.B448, ~value.B384, ~value.B320, ~value.B256, ~value.B192, ~value.B128, ~value.B64) + 1;\n    }\n    public static Int512 operator +(Int512 left, Int512 right)\n    {\n        var  larr   = left.ToUIn32Array();\n        var  rarr   = right.ToUIn32Array();\n        var  dl     = larr.Length > rarr.Length ? larr.Length : rarr.Length;\n        var  result = new uint[dl];\n        long carry  = 0;\n        for (var i = 0; i &lt; dl; i++)\n        {\n            var sum = larr[i] + (long) rarr[i] + carry;\n            carry     = sum >> 32;\n            result[i] = (uint) (sum &amp; 0xFFFFFFFF);\n        }\n        if (carry != 0)\n        {\n            var idx = 0;\n            while (idx&lt; result.Length-1)\n            {\n                if (result[idx] == 0)\n                    break;\n                idx++;\n            }\n            result[idx] = (uint) carry;\n        }\n        return new Int512(left.Sign * right.Sign, result);\n    }\n    public static Int512 operator -(Int512 left, Int512 right)\n    {\n        return left + -right;\n    }\n    public static Int512 Add(Int512 left, Int512 right)\n    {\n        return left + right;\n    }\n    public static Int512 Subtract(Int512 left, Int512 right)\n    {\n        return left - right;\n    }\n    public static Int512 Divide(Int512 dividend, Int512 divisor)\n    {\n        return DivRem(dividend, divisor, out var integer);\n    }\n    public static void Divide(Int512 dividend, Int512 divisor, out Int512 remainder, out Int512 quotient)\n    {\n        if (divisor == 0)\n            throw new DivideByZeroException();\n        DivRem(dividend.ToUIn32Array(), divisor.ToUIn32Array(), out var quo, out var rem);\n        remainder = new Int512(1,                            rem);\n        quotient  = new Int512(dividend.Sign * divisor.Sign, quo);\n    }\n    public static Int512 DivRem(Int512 dividend, Int512 divisor, out Int512 remainder)\n    {\n        if (divisor == 0)\n            throw new DivideByZeroException();\n        DivRem(dividend.ToUIn32Array(), divisor.ToUIn32Array(), out var quotient, out var rem);\n        remainder = new Int512(1, rem);\n        return new Int512(dividend.Sign * divisor.Sign, quotient);\n    }\n    private static void DivRem(uint[] dividend, uint[] divisor, out uint[] quotient, out uint[] remainder)\n    {\n        const ulong hiBit       = 0x100000000;\n        var         divisorLen  = GetLength(divisor);\n        var         dividendLen = GetLength(dividend);\n        if (divisorLen &lt;= 1)\n        {\n            ulong rem = 0;\n            var   div = divisor[0];\n            quotient  = new uint[dividendLen];\n            remainder = new uint[1];\n            for (var i = dividendLen - 1; i >= 0; i--)\n            {\n                rem *= hiBit;\n                rem += dividend[i];\n                var q = rem \/ div;\n                rem         -= q * div;\n                quotient[i] =  (uint) q;\n            }\n            remainder[0] = (uint) rem;\n            return;\n        }\n        if (dividendLen >= divisorLen)\n        {\n            var shift        = GetNormalizeShift(divisor[divisorLen - 1]);\n            var normDividend = new uint[dividendLen + 1];\n            var normDivisor  = new uint[divisorLen];\n            Normalize(dividend, dividendLen, normDividend, shift);\n            Normalize(divisor,  divisorLen,  normDivisor,  shift);\n            quotient = new uint[dividendLen - divisorLen + 1];\n            for (var j = dividendLen - divisorLen; j >= 0; j--)\n            {\n                var dx = hiBit * normDividend[j + divisorLen] + normDividend[j + divisorLen - 1];\n                var qj = dx \/ normDivisor[divisorLen                                        - 1];\n                dx -= qj * normDivisor[divisorLen - 1];\n                do\n                {\n                    if (qj &lt; hiBit &amp;&amp; qj * normDivisor[divisorLen - 2] &lt;= dx * hiBit + normDividend[j + divisorLen - 2])\n                        break;\n                    qj -= 1L;\n                    dx += normDivisor[divisorLen - 1];\n                } while (dx &lt; hiBit);\n                ulong di = 0;\n                ulong dj;\n                var   index = 0;\n                while (index &lt; divisorLen)\n                {\n                    var dqj = normDivisor[index] * qj;\n                    dj                      = normDividend[index + j] - (uint) dqj - di;\n                    normDividend[index + j] = (uint) dj;\n                    dqj                     = dqj >> 32;\n                    dj                      = dj  >> 32;\n                    di                      = dqj - dj;\n                    index++;\n                }\n                dj                           = normDividend[j + divisorLen] - di;\n                normDividend[j + divisorLen] = (uint) dj;\n                quotient[j]                  = (uint) qj;\n                if ((long)dj &lt; 0)\n                {\n                    quotient[j]--;\n                    ulong sum = 0;\n                    for (index = 0; index &lt; divisorLen; index++)\n                    {\n                        sum                     = normDivisor[index] + normDividend[j + index] + sum;\n                        normDividend[j + index] = (uint) sum;\n                        sum                     = sum >> 32;\n                    }\n                    sum += normDividend[j + divisorLen];\n                    normDividend[j        + divisorLen] = (uint) sum;\n                }\n            }\n            remainder = Unnormalize(normDividend, shift);\n            return;\n        }\n        quotient  = new uint[0];\n        remainder = dividend;\n    }\n    private static int GetLength(uint[] uints)\n    {\n        var index = uints.Length - 1;\n        while (index >= 0 &amp;&amp; uints[index] == 0)\n            index--;\n        return index + 1;\n    }\n    private static int GetNormalizeShift(uint ui)\n    {\n        var shift = 0;\n        if ((ui &amp; 0xffff0000) == 0)\n        {\n            ui    =  ui &lt;&lt; 16;\n            shift += 16;\n        }\n        if ((ui &amp; 0xff000000) == 0)\n        {\n            ui    =  ui &lt;&lt; 8;\n            shift += 8;\n        }\n        if ((ui &amp; 0xf0000000) == 0)\n        {\n            ui    =  ui &lt;&lt; 4;\n            shift += 4;\n        }\n        if ((ui &amp; 0xc0000000) == 0)\n        {\n            ui    =  ui &lt;&lt; 2;\n            shift += 2;\n        }\n        if ((ui &amp; 0x80000000) == 0)\n            shift++;\n        return shift;\n    }\n    private static uint[] Unnormalize(uint[] normalized, int shift)\n    {\n        var len          = GetLength(normalized);\n        var unnormalized = new uint[len];\n        if (shift > 0)\n        {\n            var  rshift = 32 - shift;\n            uint r      = 0;\n            for (var i = len - 1; i >= 0; i--)\n            {\n                unnormalized[i] = (normalized[i] >> shift) | r;\n                r               = normalized[i] &lt;&lt; rshift;\n            }\n        }\n        else\n        {\n            for (var j = 0; j &lt; len; j++)\n                unnormalized[j] = normalized[j];\n        }\n        return unnormalized;\n    }\n    private static void Normalize(uint[] unormalized, int len, uint[] normalized, int shift)\n    {\n        int  i;\n        uint n = 0;\n        if (shift > 0)\n        {\n            var rShift = 32 - shift;\n            for (i = 0; i &lt; len; i++)\n            {\n                normalized[i] = (unormalized[i] &lt;&lt; shift) | n;\n                n             = unormalized[i] >> rShift;\n            }\n        }\n        else\n        {\n            i = 0;\n            while (i &lt; len)\n            {\n                normalized[i] = unormalized[i];\n                i++;\n            }\n        }\n        while (i &lt; normalized.Length)\n            normalized[i++] = 0;\n        if (n != 0)\n            normalized[len] = n;\n    }\n    public static Int512 Remainder(Int512 dividend, Int512 divisor)\n    {\n        DivRem(dividend, divisor, out var remainder);\n        return remainder;\n    }\n    public static Int512 Max(Int512 left, Int512 right)\n    {\n        return left.CompareTo(right) &lt; 0 ? right : left;\n    }\n    public static Int512 Min(Int512 left, Int512 right)\n    {\n        return left.CompareTo(right) &lt;= 0 ? left : right;\n    }\n    public static int GetBitWidth(Int512 n)\n    {\n        Int512 bitWidth = 1;\n        var    v        = n;\n        while ((v >>= 1) > 0)\n            bitWidth++;\n        if (bitWidth &lt; 8)\n            bitWidth = 8;\n        while (bitWidth % 8 != 0)\n            bitWidth++;\n        return (int) bitWidth;\n    }\n    public static Int512 operator %(Int512 dividend, Int512 divisor)\n    {\n        return Remainder(dividend, divisor);\n    }\n    public static Int512 operator \/(Int512 dividend, Int512 divisor)\n    {\n        return Divide(dividend, divisor);\n    }\n    public ulong[] ToUIn64Array()\n    {\n        return new[] {B64, B128, B192, B256, B320, B384, B448, B512};\n    }\n    public uint[] ToUIn32Array()\n    {\n        var uia = new uint[16];\n        var ula = ToUIn64Array();\n        Buffer.BlockCopy(ula, 0, uia, 0, 64);\n        return uia;\n    }\n    public byte[] ToByteArray()\n    {\n        var ba  = new byte[64];\n        var ula = ToUIn64Array();\n        Buffer.BlockCopy(ula, 0, ba, 0, 64);\n        return ba;\n    }\n    public static Int512 Multiply(Int512 left, Int512 right)\n    {\n        var xInts   = left.ToUIn32Array();\n        var yInts   = right.ToUIn32Array();\n        var mulInts = new uint[Math.Max(xInts.Length, yInts.Length) &lt;&lt; 1];\n        for (var i = 0; i &lt; xInts.Length; i++)\n        {\n            var   index     = i;\n            ulong remainder = 0;\n            foreach (var yi in yInts)\n            {\n                remainder        = remainder + (ulong) xInts[i] * yi + mulInts[index];\n                mulInts[index++] = (uint) remainder;\n                remainder        = remainder >> 32;\n            }\n            while (remainder != 0)\n            {\n                remainder        += mulInts[index];\n                mulInts[index++] =  (uint) remainder;\n                remainder        =  remainder >> 32;\n            }\n        }\n        return new Int512(left.Sign * right.Sign, mulInts);\n    }\n    public static Int512 operator *(Int512 left, Int512 right)\n    {\n        return Multiply(left, right);\n    }\n    public static Int512 operator >>(Int512 value, int shift)\n    {\n        var values      = value.ToUIn64Array();\n        var valueLength = sizeof(ulong) * 8;\n        var length      = values.Length;\n        shift = shift % (length * valueLength);\n        var shiftOffset = shift \/ valueLength;\n        var bshift      = shift % valueLength;\n        var shifted     = new ulong[length];\n        for (var i = 0; i &lt; length; i++)\n        {\n            var ishift = i - shiftOffset;\n            if (ishift &lt; 0)\n                continue;\n            shifted[ishift] |= values[i] >> bshift;\n            if (bshift > 0 &amp;&amp; i + 1 &lt; length)\n                shifted[ishift] |= values[i + 1] &lt;&lt; (valueLength - bshift);\n        }\n        return new Int512(shifted[7], shifted[6], shifted[5], shifted[4], shifted[3], shifted[2], shifted[1], shifted[0]);\n    }\n    public static Int512 operator &lt;&lt;(Int512 value, int shift)\n    {\n        var values      = value.ToUIn64Array();\n        var valueLength = sizeof(ulong) * 8;\n        var length      = values.Length;\n        shift %= length * valueLength;\n        var shiftOffset = shift \/ valueLength;\n        var bshift      = shift % valueLength;\n        var shifted     = new ulong[length];\n        for (var i = 0; i &lt; length; i++)\n        {\n            var ishift = i + shiftOffset;\n            if (ishift >= length)\n                continue;\n            shifted[ishift] |= values[i] &lt;&lt; bshift;\n            if (bshift > 0 &amp;&amp; i - 1 >= 0)\n                shifted[ishift] |= values[i - 1] >> (valueLength - bshift);\n        }\n        return new Int512(shifted[7], shifted[6], shifted[5], shifted[4], shifted[3], shifted[2], shifted[1], shifted[0]);\n    }\n    public static Int512 operator |(Int512 left, Int512 right)\n    {\n        if (left == 0)\n            return right;\n        if (right == 0)\n            return left;\n        var x = left.ToUIn32Array();\n        var y = right.ToUIn32Array();\n        var z = new uint[Math.Max(x.Length, y.Length)];\n        for (var i = 0; i &lt; z.Length; i++)\n        {\n            var xu = i &lt; x.Length ? x[i] : 0u;\n            var yu = i &lt; y.Length ? y[i] : 0u;\n            z[i] = xu | yu;\n        }\n        return new Int512(left.Sign * right.Sign, z);\n    }\n    public static Int512 operator ^(Int512 left, Int512 right)\n    {\n        var x = left.ToUIn32Array();\n        var y = right.ToUIn32Array();\n        var z = new uint[Math.Max(x.Length, y.Length)];\n        for (var i = 0; i &lt; z.Length; i++)\n        {\n            var xu = i &lt; x.Length ? x[i] : 0u;\n            var yu = i &lt; y.Length ? y[i] : 0u;\n            z[i] = xu ^ yu;\n        }\n        return new Int512(left.Sign * right.Sign, z);\n    }\n    public static Int512 operator &amp;(Int512 left, Int512 right)\n    {\n        if (left == 0 || right == 0)\n            return Zero;\n        var x = left.ToUIn32Array();\n        var y = right.ToUIn32Array();\n        var z = new uint[Math.Max(x.Length, y.Length)];\n        for (var i = 0; i &lt; z.Length; i++)\n        {\n            var xu = i &lt; x.Length ? x[i] : 0u;\n            var yu = i &lt; y.Length ? y[i] : 0u;\n            z[i] = xu &amp; yu;\n        }\n        return new Int512(left.Sign * right.Sign, z);\n    }\n    private class Int512Converter : TypeConverter\n    {\n        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)\n        {\n            return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);\n        }\n        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)\n        {\n            if (value != null)\n                if (TryParse($\"{value}\", out var i))\n                    return i;\n            return new Int512();\n        }\n        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)\n        {\n            return destinationType == typeof(string) || base.CanConvertTo(context, destinationType);\n        }\n        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)\n        {\n            return destinationType == typeof(string) ? $\"{value}\" : base.ConvertTo(context, culture, value, destinationType);\n        }\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Int512 Bit Class Jun-11,2021: Obsolete Use xIntX Instead.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[91,5,90],"_links":{"self":[{"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/posts\/177"}],"collection":[{"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":3,"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":443,"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions\/443"}],"wp:attachment":[{"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaeljohnsteiner.com\/index.php\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}