require 'facets' lines = Dir['**/*.rb', '**/*.py', '**/*.cpp'].map { |f| File.read(f).lines.map(&:chars) }.inject(&:+) puts lines.sort_by(&:entropy).map(&:join).last(10).reverse
For example, could you pipe the output of `git log -p --all` through this and filter out all the commit hashes somehow?
lines = `git log -p --all`.lines.map(&:chars)
But actually an hex number regexp might me far more accurate than the entropy (e.g.: secrets are often long hex numbers).
I tried it and it yields interesting results: https://gist.github.com/28110f0b8105db11e8973d1d0be85259