Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

github.com/grahambrooks/fingerprint

Package Overview
Dependencies
1
Maintainers
0
Issues
File Explorer

github.com/grahambrooks/fingerprint

    v0.0.0-20210829165900-5ef3f6c0be48

Version published
Maintainers
0

Readme

= Fingerprint

A fingerprinting and similarity module for go.

This is an implementation of algorithm described in the http://igm.univ-mlv.fr/~mac/ENS/DOC/sigmod03-1.pdf[Winnowing: Local Algorithms for Document Fingerprinting] and can be used to fingerprint document text and calculate a similarity score using the https://en.wikipedia.org/wiki/Jaccard_index[Jaccard index or similarity coefficient]

The library works for relatively small documents and not designed for use with streams or channels.

[source,go]

package main

import ( "fmt" "github.com/grahambrooks/fingerprint/fingerprinter" "github.com/grahambrooks/fingerprint/similarity" )

func main() { score := similarity.StringSimilarity("the quick brown fox jumped over the lazy dog", "the quick brown fox jumped over the lazy dog", fingerprinter.Options{})

fmt.Printf("Similary score %f", score)

}

Produces:

[source]

go run main.go Similary score 1.000000


The similarity score is between 0 (dissimilar) to 1 similar depending on the fingerrpint options.

FAQs

Last updated on 29 Aug 2021

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc