Beispiel #1
0
 /**
  * @param string $key
  *
  * @return mixed
  */
 public function search($key)
 {
     $hash = $this->hash(trim($key));
     $value = $this->storage->read($this->dataLength, $this->position($hash) + $this->dataLength);
     $value = trim($value);
     if ('' == $value) {
         return null;
     }
     return $value;
 }
Beispiel #2
0
 /**
  * @param int $address
  *
  * @return string
  */
 private function node($address)
 {
     return $this->storage->read($this->fullLength, $address * $this->fullLength);
 }