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; } }
internal async Task WriteFieldAsync(Item.FieldType type, byte[] data) { await WriteCbcAsync((byte)type, data, data.Length); }
/// <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)); }
internal void Set(string value, Item.FieldType type, BlowFish bf) { Set(Encoding.UTF8.GetBytes(value), type, bf); }
public ItemField(Item.FieldType type) { _type = type; }