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 void Set(string key, byte[] value) { StringKey stringKey = new StringKey(key); StringRecord stringRecord = new StringRecord(stringKey, value); int index = KeyHasher.HashKey(stringKey, BucketArraySize); BucketArray.Insert(stringRecord, index); }
public void Get(string key) { StringKey stringKey = new StringKey(key); Record record; int index = KeyHasher.HashKey(stringKey, BucketArraySize); try { record = BucketArray.Select(stringKey, index); BinaryResult = record.Value; } catch (NoValueException e) { Console.WriteLine(e.Message); } }