Optimize hashing

The method IOUtils.toByteArray() is far more efficient than the formerly used while-loop.