I need a utility for Windows that calculates the checksum of the sha256 file so that when loading fedora I can check the checksum here: https://fedoraproject.org/static/checksums/Fedora-18-i386-CHECKSUM
The Microsoft utility from http://support.microsoft.com/kb/889768 only runs md5 and sha1.
I don’t want to use other downloadable tools that are not signed and inaccessible from https or from sources that I don’t know about, because it makes no sense to download unsigned code over an unencrypted connection or from an untrusted source to verify the signature of another code to trust it.
Fortunately, Google provides the ability to use https for all downloads, so I can download Go over secure connection and start from now on.
Here is a simple code that does this for a small file, but it is not very good for large files because it is not streaming.
package main import ( "io/ioutil" "crypto/sha256" "os" "log" "encoding/hex" ) func main() { hasher := sha256.New() s, err := ioutil.ReadFile(os.Args[1]) hasher.Write(s) if err != nil { log.Fatal(err) } os.Stdout.WriteString(hex.EncodeToString(hasher.Sum(nil))) }
How to make it use streams so that it works with any file size.
alpav source share