Skip to content

Instantly share code, notes, and snippets.

@capotej
Created July 20, 2009 22:59
Show Gist options
  • Save capotej/150974 to your computer and use it in GitHub Desktop.
Save capotej/150974 to your computer and use it in GitHub Desktop.
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'amatch'
=> true
irb(main):003:0> str1 = 'cd36b6dc8d4ed51b36dd7fce08f500392a7fb782'
=> "cd36b6dc8d4ed51b36dd7fce08f500392a7fb782"
irb(main):004:0> str2 = '6cac827bae250971a8b1fb6e2a96676f7a077b60'
=> "6cac827bae250971a8b1fb6e2a96676f7a077b60"
irb(main):005:0> m = Amatch::Hamming.new(str1)
=> #<Amatch::Hamming:0xb79cc5cc>
irb(main):006:0> m.match(str2)
=> 38 #-> FAIL SHOULD BE 74
irb(main):007:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment