lightning-bolt 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ require 'securerandom'
2
+ module Lightning
3
+ module Bolt
4
+ class Fuzzer
5
+
6
+ def initialize(encoder)
7
+ @encoder = encoder
8
+ @ftldrive = 0
9
+ @warp = Time.new.to_i
10
+ end
11
+
12
+ def random_number(min,max)
13
+ randomizer = seeder(nil)
14
+ return randomizer.rand(min+max)+min
15
+ end
16
+
17
+ def launch(seed, size, non_printable)
18
+ randomizer = seeder(seed)
19
+ addable = true
20
+ enigma = ""
21
+ while(enigma.length < size)
22
+ rotar = randomizer.bytes(1)
23
+ if encodable?(rotar)
24
+ enigma += rotar
25
+ end
26
+ end
27
+ return enigma.encode(@encoder)
28
+ end
29
+
30
+ private
31
+
32
+ def seeder(seed)
33
+ time = Time.new.to_i
34
+ time += @ftldrive
35
+ @ftldrive = @ftldrive + 1
36
+ seed = seed.eql?(nil) ? time : seed
37
+ return Random.new(seed)
38
+ end
39
+
40
+ def encodable?(rotar)
41
+ begin
42
+ rotar.encode(@encoder)
43
+ return true
44
+ rescue Encoding::UndefinedConversionError
45
+ return false
46
+ end
47
+ end
48
+
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,18 @@
1
+ ---
2
+ keys:
3
+ reference: "#:[a-zA-Z]+-[a-zA-Z0-9\\-]+"
4
+ data: "@:[a-zA-Z]+-[a-zA-Z0-9\\-]+"
5
+ group: (?<match>\((?:\g<match>|[^()]++)*\))
6
+ set: (?<match>\[(?:\g<match>|[^\[\]]++)*\])
7
+ singular: (?<!\\)(?:\\\\)*
8
+ exist: \?
9
+ and: (?<!\\)(?:\\\\)*\&
10
+ or: (?<!\\)(?:\\\\)*\|
11
+ not: \!
12
+ any: \.
13
+ range: \[.+\.\..+\]
14
+ repeat: \{[0-9]+:[0-9]+\}
15
+ subsets: \[(\\-|.-\\.|.-.|\\.|.)+\]
16
+ memorize: +:[a-zA-Z]+-[a-zA-Z0-9]+
17
+ subset: \<[0-9]+:[0-9]+\>
18
+ escapable: \\.