mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
A new bif unique_id(prefix) that returns a string that's unique across
Bro instaces with high probablity. "prefix" is a string that will be prepended to the returned ID.
This commit is contained in:
parent
4bdb94955d
commit
8266709e20
10 changed files with 96 additions and 59 deletions
1
testing/btest/Baseline/bifs.unique_id-rnd/count
Normal file
1
testing/btest/Baseline/bifs.unique_id-rnd/count
Normal file
|
@ -0,0 +1 @@
|
|||
6
|
3
testing/btest/Baseline/bifs.unique_id/out
Normal file
3
testing/btest/Baseline/bifs.unique_id/out
Normal file
|
@ -0,0 +1,3 @@
|
|||
A-UWkUyAuUGXf
|
||||
B-56gKBmhBBB6
|
||||
C-50da4BEzauh
|
9
testing/btest/bifs/unique_id-rnd.bro
Normal file
9
testing/btest/bifs/unique_id-rnd.bro
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
# @TEST-EXEC: BRO_SEED_FILE= bro %INPUT 2>/dev/null >out
|
||||
# @TEST-EXEC: BRO_SEED_FILE= bro %INPUT 2>/dev/null >>out
|
||||
# @TEST-EXEC: cat out | sort | uniq | wc -l >count
|
||||
# @TEST-EXEC: btest-diff count
|
||||
|
||||
print unique_id("A-");
|
||||
print unique_id("B-");
|
||||
print unique_id("C-");
|
7
testing/btest/bifs/unique_id.bro
Normal file
7
testing/btest/bifs/unique_id.bro
Normal file
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# @TEST-EXEC: bro %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
print unique_id("A-");
|
||||
print unique_id("B-");
|
||||
print unique_id("C-");
|
Loading…
Add table
Add a link
Reference in a new issue