• Kevin Burke's avatar
    crypto/sha256: add examples for New, Sum256 · 448d3952
    Kevin Burke authored
    The goal for these examples is to show how to mirror the
    functionality of the sha256sum Unix utility, a common checksumming
    tool, using the Go standard library.
    
    Add a newline at the end of the input, so users will get the same
    output if they type `echo 'hello world' | sha256sum`, since the
    builtin shell echo appends a newline by default. Also use hex output
    (instead of the shorter base64) since this is the default output
    encoding for shasum/sha256sum.
    
    Change-Id: I0036874b3cc5ba85432bfcb86f81b51c4e0238fd
    Reviewed-on: https://go-review.googlesource.com/24868Reviewed-by: 's avatarEmmanuel Odeke <emm.odeke@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    448d3952
Name
Last commit
Last update
..
aes Loading commit data...
cipher Loading commit data...
des Loading commit data...
dsa Loading commit data...
ecdsa Loading commit data...
elliptic Loading commit data...
hmac Loading commit data...
md5 Loading commit data...
rand Loading commit data...
rc4 Loading commit data...
rsa Loading commit data...
sha1 Loading commit data...
sha256 Loading commit data...
sha512 Loading commit data...
subtle Loading commit data...
tls Loading commit data...
x509 Loading commit data...
crypto.go Loading commit data...