I need to hash multiple keys from multiple threads using MessageDigest in a performance critical environment. I came to know that MessageDigest is not thread safe as it stor
As an alternative, use DigestUtils, Apache Commons' thread-safe wrapper for MessageDigest.
sha1() does what you need:
byte[] bytes = sha1(key)