mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-01-07 16:43:07 +00:00
chore: move to src
This commit is contained in:
parent
ab4c507343
commit
45b553eab6
@ -5,8 +5,6 @@ import results
|
|||||||
import private/probabilities
|
import private/probabilities
|
||||||
|
|
||||||
type
|
type
|
||||||
BloomFilterError* = object of CatchableError
|
|
||||||
|
|
||||||
BloomFilter* = object
|
BloomFilter* = object
|
||||||
capacity*: int
|
capacity*: int
|
||||||
errorRate*: float
|
errorRate*: float
|
||||||
@ -33,7 +31,7 @@ proc hashN(item: string, n: int, maxValue: int): int =
|
|||||||
|
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
||||||
proc getMOverNBitsForK(k: int, targetError: float,
|
proc getMOverNBitsForK*(k: int, targetError: float,
|
||||||
probabilityTable = kErrors): Result[int, string] =
|
probabilityTable = kErrors): Result[int, string] =
|
||||||
## Returns the optimal number of m/n bits for a given k.
|
## Returns the optimal number of m/n bits for a given k.
|
||||||
if k notin 0..12:
|
if k notin 0..12:
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import unittest, results
|
import unittest, results, strutils
|
||||||
include ../bloom_filter/bloom
|
import ../src/bloom
|
||||||
from random import rand, randomize
|
from random import rand, randomize
|
||||||
|
|
||||||
suite "bloom filter":
|
suite "bloom filter":
|
||||||
Loading…
x
Reference in New Issue
Block a user