mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
samba: update hex_filter performance
This commit is contained in:
parent
7d202f64b0
commit
fa8094da2c
1 changed files with 19 additions and 3 deletions
|
|
@ -72,9 +72,25 @@ hex_filter() {
|
|||
IFS=';'
|
||||
for i in $hex_chars;
|
||||
do
|
||||
local wc
|
||||
wc=$(echo "$dump" | grep -o "$i" | wc -w)
|
||||
wc_tot=$((wc_tot+wc))
|
||||
local filtered
|
||||
|
||||
IFS=' '
|
||||
filtered=${dump//$i/}
|
||||
|
||||
set -- $i
|
||||
divider=$#
|
||||
|
||||
set -- $dump
|
||||
start=$#
|
||||
|
||||
set -- $filtered
|
||||
end=$#
|
||||
|
||||
wc=$((start-end))
|
||||
wc=$((wc/divider))
|
||||
|
||||
[ $wc -eq 0 ] || wc_tot=$((wc_tot+wc))
|
||||
IFS=';'
|
||||
done
|
||||
|
||||
[ $wc_tot -gt $wc_max ] && echo "corrupt"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue