HashDistance() with hash of file 192 bytes length gives unclear error 'Apples != Grapes'
oneumyvakin opened this issue · 1 comments
oneumyvakin commented
STEPS
- Create file with 192 bytes length:
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
- Try to HashDistance() with some random file:
package main
import (
"github.com/glaslos/ssdeep"
"fmt"
)
func main() {
deepMaingo := ssdeep.NewSSDEEP()
deepMaingoStr := deepMaingo.Fuzzy("main.go")
fmt.Printf("deepMaingoStr: '%s'\n", deepMaingoStr)
deep192 := ssdeep.NewSSDEEP()
deep192Str := deep192.Fuzzy("192.txt")
fmt.Printf("deep192Str : '%s'\n", deep192Str )
distance, err := ssdeep.HashDistance(deepMaingoStr, deep192Str )
fmt.Printf("Distance: '%d' Error: '%s'\n", distance, err)
}
ACTUAL RESULT
Error 'Apples != Grapes' is unclear:
block size: 3, file size: 192, n/bs: 64
deep192Str: '3:OWGukOWGukOWGukOWGukOWGukOWGukOWGukOWGukOWGukOWGukOWGukOWGukOWGU:OWGukOWGukOWGukOWGukOWGukOWGukOw,"192.txt"'
Distance: '0' Error: 'Apples != Grapes'