plain-hamming
Calculate the Hamming distance between two strings using algorithm that does no input checking to be faster.
Last updated 4 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install plain-hamming 
SYNC missed versions from official npm registry.

plain-hamming build status

Calculates the Hamming distance between two strings.

Uses very simple algorithm that does no input checking to be faster, therefore make sure that the arguments you pass in are both strings of equal length.

const plainHamming = require('plain-hamming')
plainHamming('hello', 'hello')  // => 0
plainHamming('hello', 'he1lo')  // => 1
plainHamming('hello', 'he11o')  // => 2
plainHamming('hello', 'h3llo')  // => 1
plainHamming('hello', 'h3ll0')  // => 2

Installation

npm install plain-hamming

License

MIT

Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |