Update: Thanks to HN commenter, this exists! I should note, however, that it's much more secure to leave the SHA-1 hashing to the app but do your formula editing in your head where hackers can't get to (yet).
Update: Here's how to do it from a Unix command line: echo -n twitter.com0 | sha1sum | awk '{print substr($1, 1, 10)}'
This works on mac: echo -n twitter.com0 | /usr/bin/openssl sha1 | awk '{print substr($1, 1, 10)}'