• 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
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...