A Pure PHP (without any external PHP-extension) Implementation of BLAKE-256, GROESTL-256, JH-256, SKEIN-256 and KECCAK-256 hashing (cryptography) algorithms. shift-reality/php-crypto is licensed under the Apache License 2.0.
Installation (composer):
"repositories": [ { "url": "https://github.com/shift-reality/php-crypto.git", "type": "git", "reference": "newlib" } ]
"require": { "shift196/lib-akash": "1.0.*" }
Usage:
Shift196AKashLibHasher::regBuiltinAlgos();
Shift196AKashLibHasher::registerAlgo('MYHASH', new MyHashImpl());
MyHashImpl
should implement Shift196AKashLibIHashFunction
interface.
$algo = 'BLAKE256 or GROESTL256 or JH256 or SKEIN256 or KECCAK256';
$hashHex = Shift196AKashLibHasher::doHash($algo, Shift196AKashLibInputDataSupplier::forHex($dataHex))->hex(TRUE);
Just extend Shift196AKashLibInputDataSupplier
and implement abstract method getInputData
.
!!!
!!! WARNING !!!
!!!
!!! Don't use internal classes from Shift196AKashLibUtil
it can be changed without any notifications !!!
!!!
TODO:
-use PHPUnit for testing -add more algos -write Perf & Password class