MessageDigest is not thread-safe. Use DigestUtils instead, it is also more convenient (and Moquette already has a dependency on commons-codec).