These packages use the crypto/sha1 package, which mostly gives the same hashes as Git. However, the actual algorithm that Git uses is "sha1dc" (source). github.com/pjbgf/sha1cd seems to be a Go implementation of this algorithm, but I'm unsure of its reliability.