• 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
..
example_test.go Loading commit data...
fallback_test.go Loading commit data...
sha256.go Loading commit data...
sha256_test.go Loading commit data...
sha256block.go Loading commit data...
sha256block_386.s Loading commit data...
sha256block_amd64.s Loading commit data...
sha256block_decl.go Loading commit data...
sha256block_generic.go Loading commit data...
sha256block_s390x.go Loading commit data...
sha256block_s390x.s Loading commit data...