Open
Description
What You Are Seeing?
Installing large packages fail when file size is larger than 2GB.
When looking at CryptoHashProvider, it appears it reads the entire file into memory and then compute the hash, and then throw the byte[] away.
It would make sense to change the IHashAlgorithm/HashAlgorithm to handle IO.Stream
.
var hash = _hashAlgorithm.ComputeHash(_fileSystem.read_file_bytes(filePath));
What is Expected?
The ability to install large packages.
How Did You Get This To Happen? (Steps to Reproduce)
Build a large nupkg and install via chocolatey.
Output Log
Error computing hash for 'C:\ProgramData\chocolatey\lib\BigPackage\BigPackage.nupkg'
Hash will be special code for locked file or file too big instead.
Captured error:
The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.