It turns out that this is actually useful to limit the number of open files. Fixes https://github.com/tweag/gomod2nix/issues/50.
This calculates the output hashes in pure Go and removes Nix from being a run time dependency of gomod2nix. Additionally it should be faster, but that's untested.