Skip to content

Commit

Permalink
Use Hash#each_value to make rubocop happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Dec 4, 2023
1 parent 0e8e82e commit 349a3ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ronin/support/text/entropy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def self.calculate(string, base: 2)
length = string.length.to_f
entropy = 0.0

char_counts.each do |char,count|
char_counts.each_value do |count|
freq = count / length
entropy -= freq * Math.log(freq,base)
end
Expand Down

0 comments on commit 349a3ff

Please sign in to comment.