dev-master
9999999-devFile-based library for easy create and manage list of hashes
MIT
The Requires
- eggbe/helpers dev-master
- php >=7.0.0
by hacpaka
lightweight security storage hash md5 lists file-based hashes
Wallogit.com
2017 © Pedro Peláez
File-based library for easy create and manage list of hashes
The mission of this library - provide the easiest way to create and manage a list of hashes., (*1)
The library is file-based, so it doesn't require any databases., (*2)
There's the simple way to install the Eggbe/HashStore package via composer:, (*3)
composer require eggbe/hash-store
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)
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)
Currently, the only md5 hashes are supported., (*14)
This package is released under the MIT license., (*15)
File-based library for easy create and manage list of hashes
MIT
lightweight security storage hash md5 lists file-based hashes