upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf_ <fiatjaf@gmail.com>2026-04-05 12:09:04 -0300
committerGitHub <noreply@github.com>2026-04-05 12:09:04 -0300
commit413b78454f2b08e4a58c4608d97e180da038b84d (patch)
treeb2d94b5b5d6ab2a42dceb1a01431e34ed5cb73bc
parent48443c5b3a51439a1e460e8de96c050c1ea3eb09 (diff)
u32
Co-authored-by: Awiteb <a@4rs.nl>
-rw-r--r--5C.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/5C.md b/5C.md
index fc46ed2..218229c 100644
--- a/5C.md
+++ b/5C.md
@@ -30,7 +30,7 @@ Clients can publish a list of favorite scrolls using a NIP-51 standard list even
30 30
31## String Convention 31## String Convention
32 32
33Unless noted otherwise (i.e. for hex pubkeys and ids), the module passes strings to the host as `(ptr: i32, len: i32)` pairs into its linear memory. The host returns strings (and other variable-length data) by returning an `i32` pointer to a buffer in linear memory whose first 4 bytes are the `u32_be` byte-length of the payload that follows. 33Unless noted otherwise (i.e. for hex pubkeys and ids), the module passes strings to the host as `(ptr: i32, len: i32)` pairs into its linear memory. The host returns strings (and other variable-length data) by returning an `i32` pointer to a buffer in linear memory whose first 4 bytes are the `u32` byte-length of the payload that follows.
34 34
35For example, if `nostr.get_content(handle)` returns `7165` that will be a pointer to a buffer at location `7165`. If that buffer starts with `[ 00 00 00 03 ]` that means it contains 3 bytes (aside from the initial four), so we can keep reading it `[ 00 00 00 03 66 6f 6f ]` and conclude that the string is `"foo"`. 35For example, if `nostr.get_content(handle)` returns `7165` that will be a pointer to a buffer at location `7165`. If that buffer starts with `[ 00 00 00 03 ]` that means it contains 3 bytes (aside from the initial four), so we can keep reading it `[ 00 00 00 03 66 6f 6f ]` and conclude that the string is `"foo"`.
36 36