hash_update_file.phpt 515 B

1234567891011121314151617181920
  1. --TEST--
  2. Hash: hash_update_file() test
  3. --CREDITS--
  4. marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
  5. --FILE--
  6. <?php
  7. $filePath = __DIR__ . DIRECTORY_SEPARATOR . 'hash_update_stream.txt';
  8. file_put_contents($filePath, 'The quick brown fox jumped over the lazy dog.');
  9. $ctx = hash_init('md5');
  10. var_dump(hash_update_file($ctx, $filePath));
  11. echo hash_final($ctx);
  12. ?>
  13. --EXPECT--
  14. bool(true)
  15. 5c6ffbdd40d9556b73a21e63c3e0e904
  16. --CLEAN--
  17. <?php
  18. unlink(__DIR__ . DIRECTORY_SEPARATOR . 'hash_update_stream.txt');
  19. ?>