File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ from BloomFilter import BloomFilter
2+
3+ # Note to be implemented using Command line arguments
4+
5+ filename = "BloomFilter.py"
6+ user_file_content = []
7+
8+
9+ with open (filename ) as user_file :
10+
11+ for line in user_file :
12+ user_file_content .append (line )
13+
14+ user_file_NOL = len (user_file_content )
15+
16+ bloom_filter = BloomFilter (user_file_NOL )
17+
18+ for blocks in user_file_content :
19+ bloom_filter .insert (blocks )
20+
21+ print (bloom_filter .getBloomFilter ())
22+ print (bloom_filter .getSize ())
23+ print (bloom_filter .getNumberOfHashFunctions ())
24+
25+ print (user_file_content [1 ])
26+ print (bloom_filter .validate (user_file_content [1 ]))
27+
28+
29+ with open ("test" , "wb" ) as f :
30+ for i in bloom_filter .getBloomFilter ():
31+ if i == 0 :
32+ f .write (b"0" )
33+ else :
34+ f .write (b"1" )
You can’t perform that action at this time.
0 commit comments