This can be obvious, but hash_update_stream() move file pointer. So, use rewind(), if you plan to read the file after hashing.
This can be obvious, but hash_update_stream() move file pointer. So, use rewind(), if you plan to read the file after hashing.