diff options
| author | fiatjaf_ <fiatjaf@gmail.com> | 2026-04-05 12:09:04 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-05 12:09:04 -0300 |
| commit | 413b78454f2b08e4a58c4608d97e180da038b84d (patch) | |
| tree | b2d94b5b5d6ab2a42dceb1a01431e34ed5cb73bc | |
| parent | 48443c5b3a51439a1e460e8de96c050c1ea3eb09 (diff) | |
u32
Co-authored-by: Awiteb <a@4rs.nl>
| -rw-r--r-- | 5C.md | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -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 | ||
| 33 | Unless 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. | 33 | Unless 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 | ||
| 35 | For 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"`. | 35 | For 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 | ||