public unsafe static void ToString(char[] buffer, int pos, Guid value)
        {
            fixed(char *ds = &buffer[pos])
            {
                char *pd             = ds;
                var   visibleMembers = new GuidStruct(value);

                // bytes[3]
                var b = visibleMembers.B03 * 2;

                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[2]
                b = visibleMembers.B02 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[1]
                b = visibleMembers.B01 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[0]
                b = visibleMembers.B00 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                *pd++ = '-';

                // bytes[5]
                b = visibleMembers.B05 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[4]
                b = visibleMembers.B04 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                *pd++ = '-';

                // bytes[7]
                b = visibleMembers.B07 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[6]
                b = visibleMembers.B06 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                *pd++ = '-';

                // bytes[8]
                b = visibleMembers.B08 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[9]
                b = visibleMembers.B09 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                *pd++ = '-';

                // bytes[10]
                b = visibleMembers.B10 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[11]
                b = visibleMembers.B11 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[12]
                b = visibleMembers.B12 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[13]
                b = visibleMembers.B13 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[14]
                b = visibleMembers.B14 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];

                // bytes[15]
                b = visibleMembers.B15 * 2;
                *pd++ = WriteGuidLookup[b];
                *pd++ = WriteGuidLookup[b + 1];
            }

            //fixed (char* ds = &buffer[pos])
            //{
            //    char* pd = ds;
            //    var visibleMembers = new GuidStruct(value);

            //    // bytes[3]
            //    var b = visibleMembers.B03 * 2;
            //    buffer[0] = WriteGuidLookup[b];
            //    buffer[1] = WriteGuidLookup[b + 1];

            //    // bytes[2]
            //    b = visibleMembers.B02 * 2;
            //    buffer[2] = WriteGuidLookup[b];
            //    buffer[3] = WriteGuidLookup[b + 1];

            //    // bytes[1]
            //    b = visibleMembers.B01 * 2;
            //    buffer[4] = WriteGuidLookup[b];
            //    buffer[5] = WriteGuidLookup[b + 1];

            //    // bytes[0]
            //    b = visibleMembers.B00 * 2;
            //    buffer[6] = WriteGuidLookup[b];
            //    buffer[7] = WriteGuidLookup[b + 1];

            //    buffer[8] = '-';

            //    // bytes[5]
            //    b = visibleMembers.B05 * 2;
            //    buffer[9] = WriteGuidLookup[b];
            //    buffer[10] = WriteGuidLookup[b + 1];

            //    // bytes[4]
            //    b = visibleMembers.B04 * 2;
            //    buffer[11] = WriteGuidLookup[b];
            //    buffer[12] = WriteGuidLookup[b + 1];

            //    buffer[13] = '-';

            //    // bytes[7]
            //    b = visibleMembers.B07 * 2;
            //    buffer[14] = WriteGuidLookup[b];
            //    buffer[15] = WriteGuidLookup[b + 1];

            //    // bytes[6]
            //    b = visibleMembers.B06 * 2;
            //    buffer[16] = WriteGuidLookup[b];
            //    buffer[17] = WriteGuidLookup[b + 1];

            //    buffer[18] = '-';

            //    // bytes[8]
            //    b = visibleMembers.B08 * 2;
            //    buffer[19] = WriteGuidLookup[b];
            //    buffer[20] = WriteGuidLookup[b + 1];

            //    // bytes[9]
            //    b = visibleMembers.B09 * 2;
            //    buffer[21] = WriteGuidLookup[b];
            //    buffer[22] = WriteGuidLookup[b + 1];

            //    buffer[23] = '-';

            //    // bytes[10]
            //    b = visibleMembers.B10 * 2;
            //    buffer[24] = WriteGuidLookup[b];
            //    buffer[25] = WriteGuidLookup[b + 1];

            //    // bytes[11]
            //    b = visibleMembers.B11 * 2;
            //    buffer[26] = WriteGuidLookup[b];
            //    buffer[27] = WriteGuidLookup[b + 1];

            //    // bytes[12]
            //    b = visibleMembers.B12 * 2;
            //    buffer[28] = WriteGuidLookup[b];
            //    buffer[29] = WriteGuidLookup[b + 1];

            //    // bytes[13]
            //    b = visibleMembers.B13 * 2;
            //    buffer[30] = WriteGuidLookup[b];
            //    buffer[31] = WriteGuidLookup[b + 1];

            //    // bytes[14]
            //    b = visibleMembers.B14 * 2;
            //    buffer[32] = WriteGuidLookup[b];
            //    buffer[33] = WriteGuidLookup[b + 1];

            //    // bytes[15]
            //    b = visibleMembers.B15 * 2;
            //    buffer[34] = WriteGuidLookup[b];
            //    buffer[35] = WriteGuidLookup[b + 1];
            //}
        }
        public unsafe static void WriteGuid(Guid guid, char[] buffer)
        {
            // 1314FAD4-7505-439D-ABD2-DBD89242928C
            // 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
            //
            // Guid is guaranteed to be a 36 character string

            // get all the dashes in place
            buffer[8]  = '-';
            buffer[13] = '-';
            buffer[18] = '-';
            buffer[23] = '-';

            // Bytes are in a different order than you might expect
            // For: 35 91 8b c9 - 19 6d - 40 ea  - 97 79  - 88 9d 79 b7 53 f0
            // Get: C9 8B 91 35   6D 19   EA 40    97 79    88 9D 79 B7 53 F0
            // Ix:   0  1  2  3    4  5    6  7     8  9    10 11 12 13 14 15
            //
            // And we have to account for dashes
            //
            // So the map is like so:
            // bytes[0]  -> chars[3]  -> buffer[ 6, 7]
            // bytes[1]  -> chars[2]  -> buffer[ 4, 5]
            // bytes[2]  -> chars[1]  -> buffer[ 2, 3]
            // bytes[3]  -> chars[0]  -> buffer[ 0, 1]
            // bytes[4]  -> chars[5]  -> buffer[11,12]
            // bytes[5]  -> chars[4]  -> buffer[ 9,10]
            // bytes[6]  -> chars[7]  -> buffer[16,17]
            // bytes[7]  -> chars[6]  -> buffer[14,15]
            // bytes[8]  -> chars[8]  -> buffer[19,20]
            // bytes[9]  -> chars[9]  -> buffer[21,22]
            // bytes[10] -> chars[10] -> buffer[24,25]
            // bytes[11] -> chars[11] -> buffer[26,27]
            // bytes[12] -> chars[12] -> buffer[28,29]
            // bytes[13] -> chars[13] -> buffer[30,31]
            // bytes[14] -> chars[14] -> buffer[32,33]
            // bytes[15] -> chars[15] -> buffer[34,35]
            var visibleMembers = new GuidStruct(guid);

            // bytes[0]
            var b = visibleMembers.B00 * 2;

            buffer[6] = WriteGuidLookup[b];
            buffer[7] = WriteGuidLookup[b + 1];

            // bytes[1]
            b         = visibleMembers.B01 * 2;
            buffer[4] = WriteGuidLookup[b];
            buffer[5] = WriteGuidLookup[b + 1];

            // bytes[2]
            b         = visibleMembers.B02 * 2;
            buffer[2] = WriteGuidLookup[b];
            buffer[3] = WriteGuidLookup[b + 1];

            // bytes[3]
            b         = visibleMembers.B03 * 2;
            buffer[0] = WriteGuidLookup[b];
            buffer[1] = WriteGuidLookup[b + 1];

            // bytes[4]
            b          = visibleMembers.B04 * 2;
            buffer[11] = WriteGuidLookup[b];
            buffer[12] = WriteGuidLookup[b + 1];

            // bytes[5]
            b          = visibleMembers.B05 * 2;
            buffer[9]  = WriteGuidLookup[b];
            buffer[10] = WriteGuidLookup[b + 1];

            // bytes[6]
            b          = visibleMembers.B06 * 2;
            buffer[16] = WriteGuidLookup[b];
            buffer[17] = WriteGuidLookup[b + 1];

            // bytes[7]
            b          = visibleMembers.B07 * 2;
            buffer[14] = WriteGuidLookup[b];
            buffer[15] = WriteGuidLookup[b + 1];

            // bytes[8]
            b          = visibleMembers.B08 * 2;
            buffer[19] = WriteGuidLookup[b];
            buffer[20] = WriteGuidLookup[b + 1];

            // bytes[9]
            b          = visibleMembers.B09 * 2;
            buffer[21] = WriteGuidLookup[b];
            buffer[22] = WriteGuidLookup[b + 1];

            // bytes[10]
            b          = visibleMembers.B10 * 2;
            buffer[24] = WriteGuidLookup[b];
            buffer[25] = WriteGuidLookup[b + 1];

            // bytes[11]
            b          = visibleMembers.B11 * 2;
            buffer[26] = WriteGuidLookup[b];
            buffer[27] = WriteGuidLookup[b + 1];

            // bytes[12]
            b          = visibleMembers.B12 * 2;
            buffer[28] = WriteGuidLookup[b];
            buffer[29] = WriteGuidLookup[b + 1];

            // bytes[13]
            b          = visibleMembers.B13 * 2;
            buffer[30] = WriteGuidLookup[b];
            buffer[31] = WriteGuidLookup[b + 1];

            // bytes[14]
            b          = visibleMembers.B14 * 2;
            buffer[32] = WriteGuidLookup[b];
            buffer[33] = WriteGuidLookup[b + 1];

            // bytes[15]
            b          = visibleMembers.B15 * 2;
            buffer[34] = WriteGuidLookup[b];
            buffer[35] = WriteGuidLookup[b + 1];

            //writer.Write(buffer, 0, 36);
        }