1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class Sha256 extends CommonBase {
15 Sha256(Object _dummy, long ptr) { super(ptr); }
16 @Override @SuppressWarnings("deprecation")
17 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.Sha256_free(ptr); }
23 long ret = bindings.Sha256_clone_ptr(this.ptr);
28 * Creates a copy of the Sha256
30 public Sha256 clone() {
31 long ret = bindings.Sha256_clone(this.ptr);
32 if (ret >= 0 && ret <= 4096) { return null; }
33 Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); }
34 ret_hu_conv.ptrs_to.add(this);
39 * Checks if two Sha256s contain equal inner contents.
42 long ret = bindings.Sha256_hash(this.ptr);
47 * Checks if two Sha256s contain equal inner contents.
48 * This ignores pointers and is_owned flags and looks at the values in fields.
49 * Two objects with NULL inner values will be considered "equal" here.
51 public boolean eq(Sha256 b) {
52 boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr & ~1);