Skip to content

Inist-CNRS/node-jbj-numerical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numerical text processing for JBJ

Add filters to JBJ.

Installation

With npm do:

$ npm install jbj-numerical

Documentation

Usage

var JBJ = require('jbj');

JBJ.use(require('jbj-numerical'));

Filters

floatprint: alphabet

Compute float footprint

var stylesheet = {
  "set": "lorem ipsum",
  "floatprint": "abcdefgijklmnopqrstuvwxyz1234567890"
};
JBJ.render(stylesheet, console.log);
// 0.18240444179977044

loselose : true

Naive hashing where the Unicode char are summed.

var stylesheet = {
  "set": "lorem ipsum",
  "loselose": true
};
JBJ.render(stylesheet, console.log);
// 1133

pearson: true

Pearson 8-bit hash function.

var stylesheet = {
  "set": "lorem ipsum",
  "pearson": true
};
JBJ.render(stylesheet, console.log);
// 142

### djb2 : true Bernstein's djb2 hash function.

var stylesheet = {
  "set": "lorem ipsum",
  "djb2": true
};
JBJ.render(stylesheet, console.log);
// 1523634734

sdbm : true

Hash function used in sdbm.

var stylesheet = {
  "set": "lorem ipsum",
  "sdbm": true
};
JBJ.render(stylesheet, console.log);
// 76755323

fnv1a: true

Fowler–Noll–Vo hash function variant 1a.

var stylesheet = {
  "set": "lorem ipsum",
  "fnv1a": true
};
JBJ.render(stylesheet, console.log);
// 1505692836

murmur3: true

Murmur hash function version 3

var stylesheet = {
  "set": "lorem ipsum",
  "murmur3": true
};
JBJ.render(stylesheet, console.log);
// 1796952176

distincter: true

distinct counter (use cache)

var stylesheet = {
  "set": "lorem ipsum",
  "distincter": true
};
JBJ.render(stylesheet, console.log);
// 1

reseter: true

reset cache (use cache)

var stylesheet = {
  "set": "lorem ipsum",
  "reseter": true
};
JBJ.render(stylesheet, console.log);
// lorem ipsum

About

Numerical text encoding for JBJ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published