public TrHash(final Object toHash, final int maxSize) throws TrSerializableException {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA-256");
digest.reset();
final DataOutputStream digOS = new DataOutputStream(new DigestOutputStream(new NullOutputStream(), digest));
TrSerializer.serializeTo(toHash, digOS);
hash = digest.digest();
} catch (final NoSuchAlgorithmException e) {
throw new RuntimeException(e);
} catch (final IOException e) {