I'm trying to find a SHA256 hash of a string:

$ fdsafdsa | shasum -a 256 

While it returns a hash, it also throws an error:

-bash: fdsafdsa: command not found
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  -

I've tried using quotes -- to no avail. How to get rid of "-bash: fdsafdsa: command not found"?

  • 1
    In addition to the answer given below, you should be aware that the output of shasum in this case is the sha256 of the empty string. You get the same result by running shasum -a 256 < /dev/null (note that dev/null is always an empty file when you read from it). – Harald Hanche-Olsen Jan 17 at 10:41

You must log in to answer this question.

Browse other questions tagged .