Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

lcp

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

lcp

Compute the Longest Common Prefix from some strings

    1.1.0latest

Version published
Maintainers
1
Yearly downloads
11,422
increased by135.36%

Weekly downloads

Readme

Source

LCP - Longest Common Prefix

Computes the longest common prefix for strings using a Trie

API

var LCP = require('lcp') var lcp = new LCP(['fooseball', 'foobar', 'foam']) lcp.addWord('foobar') lcp.lcp() // 'fo'

or if you don't like classes

LCP.findLCP(['fooseball', 'foobar', 'foam']) // 'fo'

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc