summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2021-11-30 23:28:58 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2021-11-30 23:28:58 +0100
commitb773522b51292d69c532d51a62ae033ab6099a90 (patch)
tree3a07dd55a810b58cd3490df55615e2f19592eb43
parent60b5171a32a8f58ccca0e377e2689e794e595a55 (diff)
downloadlsd0004-b773522b51292d69c532d51a62ae033ab6099a90.tar.gz
lsd0004-b773522b51292d69c532d51a62ae033ab6099a90.zip
add bloomfilter pseudo code
-rw-r--r--draft-schanzen-r5n.xml24
1 files changed, 24 insertions, 0 deletions
diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml
index b77eff3..54ee877 100644
--- a/draft-schanzen-r5n.xml
+++ b/draft-schanzen-r5n.xml
@@ -412,6 +412,30 @@ END
412 Any bloom filter uses k=16 different hash functions each of which is 412 Any bloom filter uses k=16 different hash functions each of which is
413 defined as follows: 413 defined as follows:
414 </t> 414 </t>
415 <figure>
416 <artwork name="" type="" align="left" alt=""><![CDATA[
417BF-TEST(key, bloomfilter)
418 H_key := SHA512 (key)
419 FOR i IN 0..15
420 bit := INT(H_key[i * k]) % 1024
421 IF bloomfilter[bit] IS SET
422 RETURN TRUE
423 END
424 END
425 RETURN FALSE
426END
427
428BF-SET(key, bloomfilter)
429 H_key := SHA512 (key)
430 FOR i IN 0..15
431 bit := INT(H_key[i * k]) % 1024
432 bloomfilter[bit] := 1
433 END
434END
435 ]]></artwork>
436 </figure>
437
438
415 </section> 439 </section>
416 <section anchor="p2p_opts" numbered="true" toc="default"> 440 <section anchor="p2p_opts" numbered="true" toc="default">
417 <name>Processing options</name> 441 <name>Processing options</name>