xref: /PHP-7.3/ext/hash/tests/bug64745.phpt (revision b746e698)
1--TEST--
2Bug #64745 hash_pbkdf2() truncates data when using default length and hex output
3--SKIPIF--
4<?php extension_loaded('hash') or die('skip'); ?>
5--FILE--
6<?php
7$hash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0);
8$rawHash = hash_pbkdf2('sha1', 'password', 'salt', 1, 0, true);
9
10var_dump($hash);
11var_dump(bin2hex($rawHash));
12
13?>
14--EXPECT--
15string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
16string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
17