Currently FileSource's hash is hard-coded to be SHA256, however, several projects publish different kinds of hashes (SHA1, commonly MD5, etc). For example, NVIDIA provides MD5sums for the CUDA installers: https://developer.download.nvidia.com/compute/cuda/11.7.0/docs/sidebar/md5sum.txt. It'd be nice if we could re-use these, as I currently have to download about 10GB of CUDA binaries before updating the package :-)
As a quick hack, I guess we could just look at the length of the hash to determine its type (64=SHA256, 40=SHA1, 32=MD5).
Currently FileSource's hash is hard-coded to be SHA256, however, several projects publish different kinds of hashes (SHA1, commonly MD5, etc). For example, NVIDIA provides MD5sums for the CUDA installers: https://developer.download.nvidia.com/compute/cuda/11.7.0/docs/sidebar/md5sum.txt. It'd be nice if we could re-use these, as I currently have to download about 10GB of CUDA binaries before updating the package :-)
As a quick hack, I guess we could just look at the length of the hash to determine its type (64=SHA256, 40=SHA1, 32=MD5).