Fastest levenshtein implementation in Go.

Overview

fast-levenshtein 🚀

Fastest levenshtein implementation in Go.

Measure the difference between two strings.

note: this implementation is currently not threadsafe and it assumes that the runes only go up to 65535. This will be fixed soon.

Download

$ go get github.com/ka-weihe/fast-levenshtein

Usage

package main

import (
	"fmt"
	"github.com/ka-weihe/fast-levenshtein"
)

func main() {
	s1 := "fast"
	s2 := "fastest"
	distance := levenshtein.Distance(s1, s2)
	fmt.Printf("The distance between %s and %s is %d.\n", s1, s2, distance)
	// => The distance between fast and fastest is 3.
}

Benchmarks

kaweihe is this package. It is 15 times faster for strings of length 64 compared to the second fastest package:

Benchmark/4/kaweihe-12         	   88651	     12858 ns/op	       0 B/op	       0 allocs/op
Benchmark/4/agniva-12          	   34550	     32099 ns/op	    7984 B/op	     499 allocs/op
Benchmark/4/arbovm-12          	   31778	     49311 ns/op	   23952 B/op	     499 allocs/op
Benchmark/4/dgryski-12         	   34489	     37951 ns/op	   23952 B/op	     499 allocs/op
Benchmark/8/kaweihe-12         	   51102	     22806 ns/op	       0 B/op	       0 allocs/op
Benchmark/8/agniva-12          	   17876	     66867 ns/op	   15968 B/op	     499 allocs/op
Benchmark/8/arbovm-12          	   12945	    104283 ns/op	   39920 B/op	     499 allocs/op
Benchmark/8/dgryski-12         	   11898	     92959 ns/op	   39920 B/op	     499 allocs/op
Benchmark/16/kaweihe-12        	   26749	     43723 ns/op	       0 B/op	       0 allocs/op
Benchmark/16/agniva-12         	    6129	    195921 ns/op	   23952 B/op	     499 allocs/op
Benchmark/16/arbovm-12         	    3370	    356006 ns/op	   71856 B/op	     499 allocs/op
Benchmark/16/dgryski-12        	    3242	    371193 ns/op	   71856 B/op	     499 allocs/op
Benchmark/32/kaweihe-12        	   12588	     93955 ns/op	       0 B/op	       0 allocs/op
Benchmark/32/agniva-12         	    1604	    767277 ns/op	   39920 B/op	     499 allocs/op
Benchmark/32/arbovm-12         	     838	   1434373 ns/op	  143712 B/op	     499 allocs/op
Benchmark/32/dgryski-12        	     837	   1427871 ns/op	  143712 B/op	     499 allocs/op
Benchmark/64/kaweihe-12        	    6538	    180181 ns/op	       0 B/op	       0 allocs/op
Benchmark/64/agniva-12         	     422	   2827182 ns/op	  327344 B/op	    1497 allocs/op
Benchmark/64/arbovm-12         	     219	   5449945 ns/op	  542912 B/op	    1497 allocs/op
Benchmark/64/dgryski-12        	     219	   5457779 ns/op	  542912 B/op	    1497 allocs/op

License

This project is licensed under the MIT License - see the LICENSE.md file for details

RFC 4566 SDP implementation in go

SDP Package sdp implements SDP: Session Description Protocol [RFC4566]. Complies to gortc principles as core package. Examples See examples folder. Al

null 114 Jun 7, 2022
Go implementation of the bspatch algorithm

binarydist Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/. It reads and writes files compatibl

Keith Rarick 279 May 17, 2022
Templating system for HTML and other text documents - go implementation

FAQ What is Kasia.go? Kasia.go is a Go implementation of the Kasia templating system. Kasia is primarily designed for HTML, but you can use it for any

Michał Derkacz 74 Mar 15, 2022
A golang implementation of Norvig's segmenter

A Go language implementation of the Norvig segmenter, given in this pdf. Licensed WTFPL; please use this code in any way you would like. func MakeWord

Bill Mill 14 Sep 14, 2020
A diff3 text merge implementation in Go

Diff3 A diff3 text merge implementation in Go based on the awesome paper below. "A Formal Investigation of Diff3" by Sanjeev Khanna, Keshav Kunal, and

Keenan Nemetz 19 Apr 4, 2022
Go (golang) implementation of http://www.hashids.org

go-hashids Go (golang) v1 implementation of http://www.hashids.org under MIT License (same as the original implementations) Original implementations b

Rémi Gillig 1.1k Jun 28, 2022
Golang string comparison and edit distance algorithms library, featuring : Levenshtein, LCS, Hamming, Damerau levenshtein (OSA and Adjacent transpositions algorithms), Jaro-Winkler, Cosine, etc...

Go-edlib : Edit distance and string comparison library Golang string comparison and edit distance algorithms library featuring : Levenshtein, LCS, Ham

Hugo Bollon 329 Jun 21, 2022
Fastest levenshtein implementation in Go.

fast-levenshtein ?? Fastest levenshtein implementation in Go. Measure the difference between two strings. note: this implementation is currently not t

null 113 May 21, 2022
Go implementation to calculate Levenshtein Distance.

levenshtein Go package to calculate the Levenshtein Distance The library is fully capable of working with non-ascii strings. But the strings are not n

Agniva De Sarker 213 Jun 29, 2022
Levenshtein distance and similarity metrics with customizable edit costs and Winkler-like bonus for common prefix.

A Go package for calculating the Levenshtein distance between two strings This package implements distance and similarity metrics for strings, based o

AGExt 68 Apr 12, 2022
Levenshtein distance for golang

levenshtein An implementation of the Levenshtein distance for Golang Sources Levenshtein distance Golang Install go get github.com/gitchander/levensht

Chander 0 Jun 8, 2021
immudb - world’s fastest immutable database

immudb Note: The master branch is the joint point for all ongoing development efforts. Thus it may be in an unstable state and should not be used in p

CodeNotary 7.6k Jun 27, 2022
The world’s fastest framework for building websites.

A Fast and Flexible Static Site Generator built with love by bep, spf13 and friends in Go. Website | Forum | Documentation | Installation Guide | Cont

GoHugo.io 59.9k Jul 1, 2022
Faster than the fastest in the world pixel-by-pixel image difference tool.

imgdiff Faster than the fastest in the world pixel-by-pixel image difference tool. Why? imgdiff isn't as fast as a tool like this should be and I'm no

Nikita Tolkachev 1.6k Jun 28, 2022
The fastest dork scanner written in Go.

go-dork The fastest dork scanner written in Go. There are also various search engines supported by go-dork, including Google, Shodan, Bing, Duck, Yaho

dw1 608 Jun 22, 2022
Gerasimos (Makis) Maropoulos 22.5k Jun 26, 2022
A Golang lock-free thread-safe HashMap optimized for fastest read access.

hashmap Overview A Golang lock-free thread-safe HashMap optimized for fastest read access. Usage Set a value for a key in the map: m := &HashMap{} m.S

Cornel 1.2k Jun 30, 2022
One of the fastest alternative JSON parser for Go that does not require schema

Alternative JSON parser for Go (10x times faster standard library) It does not require you to know the structure of the payload (eg. create structs),

Leonid Bugaev 4.6k Jun 28, 2022
Fastest JSON interperter for golang

Welcome To JIN "Your wish is my command" Fast and Easy Way to Deal With JSON Jin is a comprehensive JSON manipulation tool bundle. All functions teste

eco 58 May 28, 2022
The fastest way to create self-hosted exit-servers

inletsctl - the fastest way to create self-hosted exit-servers inletsctl automates the task of creating an exit-server (tunnel server) on public cloud

inlets 411 Jun 8, 2022
Fastest recursive HTTP fuzzer, like a Ferrari.

Medusa Fastest recursive HTTP fuzzer, like a Ferrari. Usage Usage: medusa [options...] Options: -u Single URL -uL

Rıza Sabuncu 71 Jun 22, 2022
Fastest UPnP

Turbo-UPnP Installation Remember to enable UPnP on your router! go get -u github.com/DeNetPRO/turbo-upnp Usage import upnp "github.com/DeNetPRO/turbo-

DeNet 8 Jun 13, 2022
✨ Fastest Feature-packed Discord Token Checker written in GO ✨

FAST-discord-token-checker ✨ Fastest Feature-packed Discord Token Checker written in GO ✨ Overview ?? This program is the fastest ever written Discord

Vanshaj 44 Jun 10, 2022
Fastest light-weight Discord server joiner written in GO

DiscordInviterGO! Fastest light-weight Discord server joiner written in GO Disclaimer For Educational purposes only. Use at your own risk. Automation

Vanshaj 84 Jun 29, 2022
Fastest python library for making asynchronous group requests.

FGrequests: Fastest Asynchronous Group Requests Installation Install using pip: pip install fgrequests Documentation Pretty easy to use. import fgrequ

Farid Chowdhury 12 May 22, 2022
QuickAbeHiroshi - The golang program to open a web site which is the fastest in the world

The golang program to open a web site which is the fastest in the world.

atoy322 0 Jan 2, 2022
The fastest dork scanner written in Go.

go-dork The fastest dork scanner written in Go. There are also various search engines supported by go-dork, including Google, Shodan, Bing, Duck, Yaho

Mansz 0 Jan 28, 2022
The fastest file download client

Pget - The fastest file download client Description Multi-Connection Download using parallel requests. Fast Resumable Cross-compiled (windows, linux,

Kei Kamikawa 911 Jun 27, 2022
Go language implementation of a blockchain based on the BDLS BFT protocol. The implementation was adapted from Ethereum and Sperax implementation

BDLS protocol based PoS Blockchain Most functionalities of this client is similar to the Ethereum golang implementation. If you do not find your quest

Yongge Wang 0 Jan 1, 2022