Merge pull request #45 from TheBlueMatt/main
[ldk-java] / src / main / java / org / ldk / structs / Sha256.java
index 76c110a7372691e2cf37777bdd9c8900dc4a99fc..8eae39323d62b51a4a477fee6102533bbe44e09b 100644 (file)
@@ -19,17 +19,6 @@ public class Sha256 extends CommonBase {
                if (ptr != 0) { bindings.Sha256_free(ptr); }
        }
 
-       /**
-        * Checks if two Sha256s contain equal inner contents.
-        * This ignores pointers and is_owned flags and looks at the values in fields.
-        * Two objects with NULL inner values will be considered "equal" here.
-        */
-       public boolean eq(Sha256 b) {
-               boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
-               this.ptrs_to.add(b);
-               return ret;
-       }
-
        /**
         * Creates a copy of the Sha256
         */
@@ -41,4 +30,23 @@ public class Sha256 extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Checks if two Sha256s contain equal inner contents.
+        */
+       public long hash() {
+               long ret = bindings.Sha256_hash(this.ptr);
+               return ret;
+       }
+
+       /**
+        * Checks if two Sha256s contain equal inner contents.
+        * This ignores pointers and is_owned flags and looks at the values in fields.
+        * Two objects with NULL inner values will be considered "equal" here.
+        */
+       public boolean eq(Sha256 b) {
+               boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               this.ptrs_to.add(b);
+               return ret;
+       }
+
 }