protected Encryption(byte[] secretKey, byte[] utilitykey, IEncryptBehavior encryptBiavior, IDecryptBehavior decryptBiavior) { SecretKey = new BinaryKey(secretKey); UtilityKey = new BinaryKey(utilitykey); _encryptBiavior = encryptBiavior; _decryptBiavior = decryptBiavior; }
public void Set(byte[] key, byte[] value) { BinaryKey binaryKey = new BinaryKey(key); BinaryRecord binaryRecord = new BinaryRecord(binaryKey, value); int index = KeyHasher.HashKey(binaryKey, BucketArraySize); BucketArray.Insert(binaryRecord, index); }
public override bool Equals(object obj) { if (!(obj is BinaryKey)) { return(false); } BinaryKey other = (BinaryKey)obj; return(Helper.AreEqual(key, other.key)); }
public static Assembly LoadAssembly(byte[] binaryAssembly) { var key = new BinaryKey(binaryAssembly); lock (loadedAssemblies) { Assembly a; if (loadedAssemblies.TryGetValue(key, out a)) { return(a); } a = AppDomain.CurrentDomain.Load(binaryAssembly); loadedAssemblies.Add(key, a); return(a); } }
public void Get(byte[] key) { BinaryKey binaryKey = new BinaryKey(key); Record record; int index = KeyHasher.HashKey(binaryKey, BucketArraySize); try { record = BucketArray.Select(binaryKey, index); BinaryResult = record.Value; } catch (NoValueException e) { Console.WriteLine(e.Message); } }
public BinaryRecord(BinaryKey key, string value) { Key = key; Value = Encoding.UTF8.GetBytes(value); }
public BinaryRecord(BinaryKey key, byte[] value) { Key = key; Value = value; }