Skip to content
This repository has been archived by the owner on May 11, 2019. It is now read-only.
/ pbkdf2-compat Public archive

A compatibility library for the PHP 5.5 function hash_pbkdf2().

License

Notifications You must be signed in to change notification settings

eloquent/pbkdf2-compat

Repository files navigation

PBKDF2-compat

A compatibility library for the PHP 5.5 function hash_pbkdf2().

The most recent stable version is 1.0.1 Current build status image Current coverage status image

Installation and documentation

What does it do?

This library provides a forwards-compatible implementation of the hash_pbkdf2() function introduced in PHP 5.5. It allows the use of this function in versions of PHP prior to 5.5, and falls back to the native function when it is available.

Usage

See the PHP manual entry.

Behaviour of length parameter

Although the documentation does not specify, the $length parameter refers to the resulting string length, not the length of the raw hash. This means that when $raw_output is false, $length needs to be doubled to produce a hash containing the same amount of data (because hex encoding doubles the number of bytes in the result string).

Acknowledgements

Inspired by ircmaxell/password_compat. PBKDF2 implementation derived from Symfony's Pbkdf2PasswordEncoder.

About

A compatibility library for the PHP 5.5 function hash_pbkdf2().

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages