2017 © Pedro Peláez
 

library hash-store

File-based library for easy create and manage list of hashes

image

eggbe/hash-store

File-based library for easy create and manage list of hashes

  • Monday, February 6, 2017
  • by eggbe
  • Repository
  • 1 Watchers
  • 1 Stars
  • 37 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Introduction

The mission of this library - provide the easiest way to create and manage a list of hashes., (*1)

Features

The library is file-based, so it doesn't require any databases., (*2)

Requirements

Install

There's the simple way to install the Eggbe/HashStore package via composer:, (*3)

composer require eggbe/hash-store

Configuration

Please, follow the example below:, (*4)

$HashStore = new \Eggbe\HashStore\HashStore([
    'path' => 'path-to-storage-directory',
    'sort' => HashStore::BY_DATE | HashStore::BY_DESC,
    'filter' => '^.{0,32}$',
]);

The path option defines the directory to store all generated files. Please, be sure that directory exists and writable, or you risk to get an exception otherwise., (*5)

The sort option specifies the sorting and can take the combination of binary flags. Currently, you can choose the sorting by alphabet or by creation date in direct and reverse order., (*6)

The filter option set the regular expression for keywords syntax checking. If any given keyword doesn't match this expression, the exception will be thrown., (*7)

Usage

You have to use the following method to create and add new hash into storage:, (*8)

$HashStore->create('keyword');

Also, you always can view all existing hashes via the following code:, (*9)

foreach($HashStore->all() as $keyword => $content){
    echo $keyword . ' ' . $content;
}  

The following method helps you to find any hash by a keyword:, (*10)

$hash = $HashStore->find('keyword');

But if you need to get a keyword by a hash so it also possible:, (*11)

$keyword = $HashStore->search('a2f51b04c9a31cd2defc4d3550eecb71');

Of course you can remove any hash if you really need:, (*12)

$HashStore->remove('keyword');

Unfortunately currently this library support only md5 hashes usage but we have plans to extend of the functionality. We will keep you in touch!, (*13)

Limitation

Currently, the only md5 hashes are supported., (*14)

License

This package is released under the MIT license., (*15)

The Versions

06/02 2017

dev-master

9999999-dev

File-based library for easy create and manage list of hashes

  Sources   Download

MIT

The Requires

 

by hacpaka

lightweight security storage hash md5 lists file-based hashes