bitcoinj/bitcoinj — pull request #30 by malkusch (2014-03-17 15:30:10+00:00)
Title: avoid synchronized blocks during address decoding

I noticed in `Base58` `synchronized` blocks which might lead to performance impacts in concurrent applications during address decoding. The motivation of these synchronized blocks is probably that reusing the SHA-256 digest is not thread safe. I didn't do the performance tests myself, but [this guy did](http://stackoverflow.com/a/17555580/1346207) and it seems to me also very natural that creating new digest instances should be no big deal. It should at least not justify a synchronized singleton.
I added also a test to show that the concurrent usage of the new `getDigest()` method has no side effects. Which goes also very well with the contract of [`MessageDigest.getInstance()`](http://docs.oracle.com/javase/7/docs/api/java/security/MessageDigest.html#getInstance%28java.lang.String%29)
> A **new** MessageDigest object encapsulating the MessageDigestSpi implementation from the first Provider that supports the specified algorithm is returned.