Here is the code provided on the manual:
// Does file have the given hash?
$validator = new \Zend\Validator\File\Md5('3b3652f336522365223');
I'm not quite understanding how to use this as a file validator inside my Zend Form
. How do I prepopulate the hash when the file has not been uploaded yet?
You don't. The hash validator is to ensure that the uploaded file has a provided hash. I.e. that you already know the hash of the file (either that the file has been uploaded earlier, you've gotten the hash from a 3rd party, or the expected hash of the file was included in the request), and want to verify that the file that were uploaded has the same hash.
See for example How to calculate the MD5 hash of a file using javascript for how to provide the expected MD5 hash together with the uploaded file to validate that the file was uploaded correctly.
The question then becomes what the problem you're trying to solve is - most servers will cancel the request if the request is aborted while the file is being uploaded (so an incomplete file will usually not be handed to your code).