Copyright Infringement Notice

Feb 1, 2014 at 1:17 PM
The HigLabo project has been stealing MimeKit code and removing my copyright notices. The recently-added Base64Converter, QuotedPrintableConverter and CharTypeTable classes are direct rip-offs of code found in MimeKit. Perhaps other code as well. The fact that the HigLabo author(s) explicitly removed my copyright notices, I must say, makes me quite annoyed.

Please add back my copyright headers or remove my code from your project.

I've already emailed you about this matter and you've chosen to ignore it.

Hope to hear back soon,

Jeff
Coordinator
Feb 3, 2014 at 2:43 AM
Feb 3, 2014 at 3:31 AM
I sent you an email 24 hours before I posted to the forums about this, not 30 minutes. You must not be factoring in timezone offsets correctly.

My email was sent Friday morning, I didn't post to the forums until Saturday morning.
Point out filename and line number that you think copy from your MimeKit within a week.
All code that you point out, I'll remove them completely.
I already did: CharTypeTable.cs, Base64Converter.cs, and QuotedPrintableConverter.cs are copied from MimeKit.

You changed the class names but kept the variable names the same. You merged MimeKit's Base64Decoder.cs and Base64Encoder.cs into your Base64Converter.cs that you checked in earlier this week. You can check that my Base64Encoder/Decoder files in MimeKit have existed for a year.

Here's your CharTypeTable.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HigLabo.Mime.Internal
{
    [Flags]
    public enum CharType : ushort
    {
        None = 0,
        IsAscii = (1 << 0),
        IsAtom = (1 << 1),
        IsAttrChar = (1 << 2),
        IsBlank = (1 << 3),
        IsControl = (1 << 4),
        IsDomainSafe = (1 << 5),
        IsEncodedPhraseSafe = (1 << 6),
        IsEncodedWordSafe = (1 << 7),
        IsQuotedPrintableSafe = (1 << 8),
        IsSpace = (1 << 9),
        IsSpecial = (1 << 10),
        IsTokenSpecial = (1 << 11),
        IsWhitespace = (1 << 12),
        IsXDigit = (1 << 13),
    }
    public static class CharTypeExtensions
    {
        public static bool HasFlag(this CharType e, CharType other)
        {
            return ((e & other) == other);
        }
    }
    public class CharTypeTable
    {
        const string AtomSafeCharacters = "!#$%&'*+-/=?^_`{|}~";
        const string AttributeSpecials = "*'%";    // attribute specials from rfc2184
        const string CommentSpecials = "()\\\r";   // not allowed in comments
        const string DomainSpecials = "[]\\\r \t"; // not allowed in domains
        const string EncodedWordSpecials = "()<>@,;:\"/[]?.=_";  // rfc2047 5.1
        const string EncodedPhraseSpecials = "!*+-/=_";          // rfc2047 5.3
        const string Specials = "()<>@,;:\\\".[]";
        internal const string TokenSpecials = "()<>@,;:\\\"/[]?=";
        const string Whitespace = " \t\r\n";

        static readonly CharType[] table = new CharType[256];

        static void RemoveFlags (string values, CharType bit)
        {
            for (int i = 0; i < values.Length; i++)
                table[(byte) values[i]] &= ~bit;
        }

        static void SetFlags (string values, CharType bit, CharType bitcopy, bool remove)
        {
            int i;

            if (remove) {
                for (i = 0; i < 128; i++)
                    table[i] |= bit;

                for (i = 0; i < values.Length; i++)
                    table[values[i]] &= ~bit;

                if (bitcopy != CharType.None) {
                    for (i = 0; i < 256; i++) {
                        if (table[i].HasFlag (bitcopy))
                            table[i] &= ~bit;
                    }
                }
            } else {
                for (i = 0; i < values.Length; i++)
                    table[values[i]] |= bit;

                if (bitcopy != CharType.None) {
                    for (i = 0; i < 256; i++) {
                        if (table[i].HasFlag (bitcopy))
                            table[i] |= bit;
                    }
                }
            }
        }

        static CharTypeTable()
        {
            for (int i = 0; i < 256; i++) {
                if (i < 127) {
                    if (i < 32)
                        table[i] |= CharType.IsControl;
                    if (i > 32)
                        table[i] |= CharType.IsAttrChar;
                    if ((i >= 33 && i <= 60) || (i >= 62 && i <= 126) || i == 32)
                        table[i] |= (CharType.IsQuotedPrintableSafe | CharType.IsEncodedWordSafe);
                    if ((i >= '0' && i <= '9') || (i >= 'a' && i <= 'z') || (i >= 'A' && i <= 'Z'))
                        table[i] |= CharType.IsEncodedPhraseSafe | CharType.IsAtom;
                    if ((i >= '0' && i <= '9') || (i >= 'a' && i <= 'f') || (i >= 'A' && i <= 'F'))
                        table[i] |= CharType.IsXDigit;

                    table[i] |= CharType.IsAscii;
                } else {
                    if (i == 127)
                        table[i] |= CharType.IsAscii;

                    table[i] |= CharType.IsControl;
                }
            }

            table['\t'] |= CharType.IsQuotedPrintableSafe | CharType.IsBlank;
            table[' '] |= CharType.IsSpace | CharType.IsBlank;

            SetFlags (Whitespace, CharType.IsWhitespace, CharType.None, false);
            SetFlags (AtomSafeCharacters, CharType.IsAtom, CharType.None, false);
            SetFlags (TokenSpecials, CharType.IsTokenSpecial, CharType.IsControl, false);
            SetFlags (Specials, CharType.IsSpecial, CharType.None, false);
            SetFlags (DomainSpecials, CharType.IsDomainSafe, CharType.None, true);
            RemoveFlags (Specials, CharType.IsAtom);
            RemoveFlags (EncodedWordSpecials, CharType.IsEncodedWordSafe);
            RemoveFlags (AttributeSpecials + TokenSpecials, CharType.IsAttrChar);
            SetFlags (EncodedPhraseSpecials, CharType.IsEncodedPhraseSafe, CharType.None, false);
        }

        public static bool IsAscii (byte c)
        {
            return table[c].HasFlag (CharType.IsAscii);
        }

        public static bool IsAtom (byte c)
        {
            return table[c].HasFlag (CharType.IsAtom);
        }

        public static bool IsAttr (byte c)
        {
            return table[c].HasFlag (CharType.IsAttrChar);
        }

        public static bool IsBlank (byte c)
        {
            return table[c].HasFlag (CharType.IsBlank);
        }

        public static bool IsCtrl (byte c)
        {
            return table[c].HasFlag (CharType.IsControl);
        }

        public static bool IsDomain (byte c)
        {
            return table[c].HasFlag (CharType.IsDomainSafe);
        }

        public static bool IsQpSafe (byte c)
        {
            return table[c].HasFlag (CharType.IsQuotedPrintableSafe);
        }

        public static bool IsToken(byte c)
        {
            return !IsTokenSpecial(c) && !IsWhitespace(c) && !IsCtrl(c);
        }

        public static bool IsTokenSpecial (byte c)
        {
            return table[c].HasFlag (CharType.IsTokenSpecial);
        }

        public static bool IsType (byte c, CharType type)
        {
            return (table[c] & type) != 0;
        }

        public static bool IsWhitespace (byte c)
        {
            return table[c].HasFlag (CharType.IsWhitespace);
        }

        public static bool IsXDigit (byte c)
        {
            return table[c].HasFlag (CharType.IsXDigit);
        }

        public static byte ToLower (byte c)
        {
            if (c >= 0x41 && c <= 0x5A)
                return (byte) (c + 0x20);

            return c;
        }

        public static byte ToUpper (byte c)
        {
            if (c >= 0x61 && c <= 0x7A)
                return (byte) (c - 0x20);

            return c;
        }

        public static byte ToXDigit (byte c)
        {
            if (c >= 0x41) {
                if (c >= 0x61)
                    return (byte) (c - (0x61 - 0x0a));

                return (byte) (c - (0x41 - 0x0A));
            }

            return (byte) (c - 0x30);
        }
    }
}
You copied that from here: MimeKit.ByteExtensions

Your Base64Converter class's variables are named exactly the same as the ones in my Base64Encoder/Decoder classes - you even have a method named EstimateOutputLength() which is the same as in mine. Your look-up tables are copied exactly.

You added Base64Converter.cs to your project less than a week ago. Mine has existed since 2012. Are you saying you just magically happened to use the same variable and method names as if by coincidence?

The same for the QuotedPrintableConverter class you added last week.
Your code is nothing special, I can easily create it by myself.
If I was to go all out you'd be as nothing to me. 
If you can create it yourself, why didn't you?
Well, you might be the average skill about programing.
But not only learning how to program, you should learn the etiquette in the online community.
I will have nothing to do with you.
That suits me just fine. Remove those 3 files and any other files you copied from MimeKit.