Class: Ronin::CLI::Commands::Entropy Private
- Inherits:
-
FileProcessorCommand
- Object
- Core::CLI::Command
- Ronin::CLI::Command
- FileProcessorCommand
- Ronin::CLI::Commands::Entropy
- Defined in:
- lib/ronin/cli/commands/entropy.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Filters lines by their entropy.
Usage
ronin entropy [] [FILE ...]
Options
-e, --entropy DEC Minimum required entropy (Default: 4.0)
-h, --help Print help information
Arguments
[FILE ...] Optional file(s) to process
Instance Method Summary collapse
-
#process_input(input) ⇒ Object
private
Filters the input stream for high-entropy strings.
Methods inherited from FileProcessorCommand
#open_file, #process_file, #run
Instance Method Details
#process_input(input) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Filters the input stream for high-entropy strings.
62 63 64 65 66 67 68 69 70 |
# File 'lib/ronin/cli/commands/entropy.rb', line 62 def process_input(input) entropy = [:entropy] input.each_line(chomp: true) do |line| if Support::Text::Entropy.calculate(line) > entropy puts line end end end |