public Hash256 finish() { byte[] half = digestBytes(); return new Hash256(half); }
public static HalfSha512 prefixed256(Prefix bytes) { HalfSha512 halfSha512 = new HalfSha512(); halfSha512.update(bytes); return halfSha512; }
public static Hash256 prefixedHalfSha512(Prefix prefix, byte[] blob) { HalfSha512 messageDigest = HalfSha512.prefixed256(prefix); messageDigest.update(blob); return messageDigest.finish(); }
@Override public Hash256 newInstance(byte[] b) { return new Hash256(b); }
public boolean isZero() { return this == Hash256.ZERO_256 || equals(Hash256.ZERO_256); }
@Override public int compareTo(Subclass another) { byte[] thisBytes = bytes(); byte[] bytes = another.bytes(); return compareBytes(thisBytes, bytes, 0, thisBytes.length); }
public static Hash256 bookStart(Issue pays, Issue gets) { return zeroQuality(createBookBase(pays, gets)); }
/** * @return A copy of index, with the lowest 8 bytes all zeroed. */ private static Hash256 zeroQuality(Hash256 fullIndex) { return quality(fullIndex, null); }
@Override public Hash160 newInstance(byte[] b) { return new Hash160(b); }
public int divergenceDepth(Hash256 other) { return divergenceDepth(0, other); } public int divergenceDepth(int i, Hash256 other) {
@Override public byte[] toBytes() { return translate.toBytes(this); }
public Hash256 hash256() { return Hash256.translate.fromParser(parser); } public Vector256 vector256() {
@Override public void toBytesSink(BytesSink to) { for (Hash256 hash256 : this) { hash256.toBytesSink(to); } }
@Override public String toHex() { return translate.toHex(this); }
@Override public Object toJSON() { return translate.toJSON(this); }
public byte[] slice(int start) { return slice(start, 0); }
public int compareStartingAt(Subclass another, int start) { byte[] thisBytes = bytes(); byte[] bytes = another.bytes(); return compareBytes(thisBytes, bytes, start, thisBytes.length); }