Example #1
0
 public static void SetOutputColumnDataType(IDTSOutputColumn outputColumn)
 {
     outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 20, 0, 0, 0);
 }
Example #2
0
        /// <summary>
        /// Configures the output column to the correct data type and length.
        /// </summary>
        /// <param name="propertyValue">The type of output that is to be produced</param>
        /// <param name="outputColumn">The column to configure</param>
        public static void SetOutputColumnDataType(MultipleHash.HashTypeEnumerator propertyValue, MultipleHash.OutputTypeEnumerator dataTypeValue, IDTSOutputColumn outputColumn)
        {
            switch (dataTypeValue)
            {
            case MultipleHash.OutputTypeEnumerator.HexString:
                switch (propertyValue)
                {
                case MultipleHash.HashTypeEnumerator.None:
                case MultipleHash.HashTypeEnumerator.MD5:
                case MultipleHash.HashTypeEnumerator.MurmurHash3a:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 34, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.RipeMD160:
                case MultipleHash.HashTypeEnumerator.SHA1:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 42, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA256:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 66, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA384:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 98, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA512:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 130, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.CRC32:
                case MultipleHash.HashTypeEnumerator.CRC32C:
                case MultipleHash.HashTypeEnumerator.FNV1a32:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 10, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.FNV1a64:
                case MultipleHash.HashTypeEnumerator.xxHash:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 18, 0, 0, 1252);
                    break;
                }
                break;

            case MultipleHash.OutputTypeEnumerator.Base64String:
                switch (propertyValue)
                {
                case MultipleHash.HashTypeEnumerator.None:
                case MultipleHash.HashTypeEnumerator.MD5:
                case MultipleHash.HashTypeEnumerator.MurmurHash3a:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 24, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.RipeMD160:
                case MultipleHash.HashTypeEnumerator.SHA1:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 28, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA256:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 44, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA384:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 64, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA512:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 88, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.CRC32:
                case MultipleHash.HashTypeEnumerator.CRC32C:
                case MultipleHash.HashTypeEnumerator.FNV1a32:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 8, 0, 0, 1252);
                    break;

                case MultipleHash.HashTypeEnumerator.FNV1a64:
                case MultipleHash.HashTypeEnumerator.xxHash:
                    outputColumn.SetDataTypeProperties(DataType.DT_STR, 12, 0, 0, 1252);
                    break;
                }
                break;

            case MultipleHash.OutputTypeEnumerator.Binary:
            default:
                switch (propertyValue)
                {
                case MultipleHash.HashTypeEnumerator.None:
                case MultipleHash.HashTypeEnumerator.MD5:
                case MultipleHash.HashTypeEnumerator.MurmurHash3a:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 16, 0, 0, 0);
                    break;

                case MultipleHash.HashTypeEnumerator.RipeMD160:
                case MultipleHash.HashTypeEnumerator.SHA1:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 20, 0, 0, 0);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA256:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 32, 0, 0, 0);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA384:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 48, 0, 0, 0);
                    break;

                case MultipleHash.HashTypeEnumerator.SHA512:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 64, 0, 0, 0);
                    break;

                case MultipleHash.HashTypeEnumerator.CRC32:
                case MultipleHash.HashTypeEnumerator.CRC32C:
                case MultipleHash.HashTypeEnumerator.FNV1a32:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 4, 0, 0, 0);
                    break;

                case MultipleHash.HashTypeEnumerator.FNV1a64:
                case MultipleHash.HashTypeEnumerator.xxHash:
                    outputColumn.SetDataTypeProperties(DataType.DT_BYTES, 8, 0, 0, 0);
                    break;
                }
                break;
            }
        }