|
|
Log in / Subscribe / Register

SHA256 | base64

SHA256 | base64

Posted Feb 1, 2014 16:53 UTC (Sat) by lambda (subscriber, #40735)
In reply to: SHA256 | base64 by ploxiln
Parent article: OpenSSH 6.5 released

You can instead use:

sha256sum () {
    openssl sha256 -binary "$@" | base64
}


to post comments

SHA256 | base64

Posted Feb 1, 2014 17:04 UTC (Sat) by lambda (subscriber, #40735) [Link]

By the way, my version of the base64 command defaults to encoding, while it looks like the one mentioned above defaults to decoding; and they don't take the same options so you can't write something portable to both (mine doesn't have the -e option).

If we're already using the openssl command, we can work around that difference with:

sha256sum () {
    openssl sha256 -binary "$@" | openssl base64
}


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds