Download the PHP package lyoshenka/php-hmac without Composer
On this page you can find all versions of the php package lyoshenka/php-hmac. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download lyoshenka/php-hmac
More information about lyoshenka/php-hmac
Files in lyoshenka/php-hmac
Download lyoshenka/php-hmac
More information about lyoshenka/php-hmac
Files in lyoshenka/php-hmac
Vendor lyoshenka
Package php-hmac
Short Description A generic HMAC function that can be used with any hash
License MIT
Homepage https://github.com/lyoshenka/php-hmac
Package php-hmac
Short Description A generic HMAC function that can be used with any hash
License MIT
Homepage https://github.com/lyoshenka/php-hmac
Please rate this library. Is it a good library?
Informations about the package php-hmac
php-hmac
A generic HMAC function that can be used with any hash
Install
composer install lyoshenka/php-hmac
Use
<?php
require __DIR__.'/vendor/autoload.php';
# Ensure that your hash functions returns raw output (not hex)
$sha256Fn = function($message) { return hash('sha256', $message, true); };
# Look up the block size - https://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions
$blockSize = 64; // make sure this in bytes, not bits
# Compute the HMAC digest
$digest = \lyoshenka\hmac("The message text goes here", "secret-key", $sha256Fn, $blockSize);
# Output the digest as a hex string
echo bin2hex($digest) . "\n";
Examples
See examples.php
References
All versions of php-hmac with dependencies
PHP Build Version
Package Version
Requires
php Version
^5.4 || ^7.0
The package lyoshenka/php-hmac contains the following files
Loading the files please wait ...