Based on python implementation https://github.com/parkr/near-dup-detection