Пример #1
0
 internal void Set(byte[] value, Item.FieldType type, BlowFish bf)
 {
     _length = value.Length;
     if (_length == 0)
     {
         _data = null;
     }
     else
     {
         _data = bf.Encrypt_ECB(value);
     }
     if (type != Item.FieldType.End)
     {
         _type = type;
     }
 }
Пример #2
0
 internal async Task WriteFieldAsync(Item.FieldType type, byte[] data)
 {
     await WriteCbcAsync((byte)type, data, data.Length);
 }
Пример #3
0
 /// <summary>
 /// Checks whether or not a given field is valid.
 /// </summary>
 /// <param name="field">The field data to validate.</param>
 /// <param name="type">The field type.</param>
 /// <returns>returns true if the field is valid; false otherwise.</returns>
 public bool IsFieldValid(string field, Item.FieldType type)
 {
     return(_checkers.ContainsKey(type) ? _checkers[type].Validate(field) : _defaultChecker.Validate(field));
 }
Пример #4
0
 internal void Set(string value, Item.FieldType type, BlowFish bf)
 {
     Set(Encoding.UTF8.GetBytes(value), type, bf);
 }
Пример #5
0
 public ItemField(Item.FieldType type)
 {
     _type = type;
 }