Earlier quoted context omitted.
or easier and shorter: printf PaSSw0rd | sha1sum
What if my password contains % characters?
python -c 'import hashlib; print hashlib.sha1("reALpassWORD12%12").hexdigest()'
and then: history -d $((HISTCMD-2))
to delete the last entry in the bash history.