X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FDescription.cs;h=adbbd7910792c5ce522fb28de67617c88a430d4f;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=0a7a450df3441e1e0e2cb1db4c6c6de4e3a8fa64;hpb=8aa8a96fc6d8fcdd3fbb419b4b4c12482af14938;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/Description.cs b/c_sharp/src/org/ldk/structs/Description.cs index 0a7a450d..adbbd791 100644 --- a/c_sharp/src/org/ldk/structs/Description.cs +++ b/c_sharp/src/org/ldk/structs/Description.cs @@ -37,7 +37,7 @@ public class Description : CommonBase { } /** - * Checks if two Descriptions contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the Description. */ public long hash() { long ret = bindings.Description_hash(this.ptr); @@ -67,12 +67,12 @@ public class Description : CommonBase { } /** * Creates a new `Description` if `description` is at most 1023 __bytes__ long, - * returns `CreationError::DescriptionTooLong` otherwise + * returns [`CreationError::DescriptionTooLong`] otherwise * * Please note that single characters may use more than one byte due to UTF8 encoding. */ public static Result_DescriptionCreationErrorZ of(string description) { - long ret = bindings.Description_new(description); + long ret = bindings.Description_new(InternalUtils.encodeString(description)); GC.KeepAlive(description); if (ret >= 0 && ret <= 4096) { return null; } Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret); @@ -80,13 +80,15 @@ public class Description : CommonBase { } /** - * Returns the underlying description `String` + * Returns the underlying description [`String`] */ public string into_inner() { - string ret = bindings.Description_into_inner(this.ptr); + long ret = bindings.Description_into_inner(this.ptr); GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + string ret_conv = InternalUtils.decodeString(ret); if (this != null) { this.ptrs_to.AddLast(this); }; - return ret; + return ret_conv; } }