Socket
Book a DemoInstallSign in
Socket

hamming-distance-ts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hamming-distance-ts

Hamming distance in TypeScript

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

hamming-distance-ts

Hamming distance in TypeScript.

Motivation

There are other pure JS hamming distance libraries out there that I could have written a TypeScript declaration file for, but I wanted to learn about writing and publishing TypeScript libraries and I needed hamming distance computation for another project.

Installation

npm install --save hamming-distance-ts

Now you can have your Hamming distances and some types too!

Usage

import { hammingDistance } from "hamming-distance-ts";

const hexString1 = "deadbeef" // these could also be Buffers
const hexString2 = "deadbeff"

const hd = hammingDistance(hexString1, hexString2)
// hd === 1

License

MIT

FAQs

Package last updated on 29 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts