Skip to content

tobsn/flexihash.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

var flexihash = require('./flexihash');

var flexi = new flexihash();

// bulk add
flexi.addTargets( ['cache-1', 'cache-2', 'cache-3'] );

// simple lookup
flexi.lookup( 'object-a' ); // "cache-1"
flexi.lookup( 'object-b' ); // "cache-2"

// add and remove
flexi.addTarget( 'cache-4' ).removeTarget( 'cache-1' );

// lookup with next-best fallback (for redundant writes)
flexi.lookupList( 'object', 2 ); // ["cache-2", "cache-4"]

// remove cache-2, expect object to hash to cache-4
flexi.removeTarget( 'cache-2' );
flexi.lookup( 'object' ); // "cache-4"

About

flexihash for node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published