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>2024-11-11 22:12:37 -0300
committerfiatjaf <fiatjaf@gmail.com>2026-02-04 19:22:23 -0300
commitbef08781af876345d761aef7c263593170862060 (patch)
tree55d3b41c7bc2c6a08b56bcc09d400eb77772128e
parentf1ed55e8e9d861938670f34c7251713d3ebab235 (diff)
nip45: a mike dilger fix and a change inspired by a mike dilger fix.
-rw-r--r--45.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/45.md b/45.md
index 6bb4203..d5c6597 100644
--- a/45.md
+++ b/45.md
@@ -43,11 +43,11 @@ This is so it enables merging results from multiple relays and yielding a reason
43 43
44This section describes the steps a relay should take in order to return HLL values to clients. 44This section describes the steps a relay should take in order to return HLL values to clients.
45 45
461. Upon receiving a filter, if it has a single `#e`, `#p`, `#a` or `#q` item, read its 32th ascii character as a byte and take its modulo over 24 to obtain an `offset` -- in the unlikely case that the filter doesn't meet these conditions, set `offset` to the number 16; 461. Upon receiving a filter, if it has a single `#e`, `#p`, `#a` or `#q` item, read its 32th ascii character as a nibble (a half-byte, a number between 0 and 16) and add `8` to it to obtain an `offset` -- in the unlikely case that the filter doesn't meet these conditions, set `offset` to the number `16`;
472. Initialize 256 registers to 0 for the HLL value; 472. Initialize 256 registers to `0` for the HLL value;
483. For all the events that are to be counted according to the filter, do this: 483. For all the events that are to be counted according to the filter, do this:
49 1. Read byte at position `offset` of the event `pubkey`, its value will be the register index `ri`; 49 1. Read byte at position `offset` of the event `pubkey`, its value will be the register index `ri`;
50 2. Count the number of leading zero bits starting at position `offset+1` of the event `pubkey`; 50 2. Count the number of leading zero bits starting at position `offset+1` of the event `pubkey` and add `1`;
51 3. Compare that with the value stored at register `ri`, if the new number is bigger, store it. 51 3. Compare that with the value stored at register `ri`, if the new number is bigger, store it.
52 52
53That is all that has to be done on the relay side, and therefore the only part needed for interoperability. 53That is all that has to be done on the relay side, and therefore the only part needed for interoperability.