Permalink
Browse files

Docco compatible comments.

  • Loading branch information...
brianloveswords committed Dec 11, 2010
1 parent 241e53c commit 23f6eba8ef5475fb239738d8f50288879e7e0d4b
Showing with 10 additions and 0 deletions.
  1. +10 −0 distance.js
View
@@ -1,3 +1,13 @@
+// String Distance
+//
+// Developed by Brian J. Brennan
+// Copyright (c) 2010
+// MIT license
+
+// Compute a modified Hamming distance. The standard Hamming distance requires
+// the strings to be the same length. This version can take strings of any
+// size and applies the difference in length to the distance, so `ham` and
+// `hamsled` will have a distance of 4.
var hamming = function(str1, str2){
var dist = 0,
big = str1,

0 comments on commit 23f6eba

Please sign in to comment.