{"id":17771394,"url":"https://github.com/rootslab/hazz","last_synced_at":"2026-05-19T07:04:30.890Z","repository":{"id":57261885,"uuid":"110027136","full_name":"rootslab/hazz","owner":"rootslab","description":"Hazz, a pseudo-random-data-filled-table, to generate k indipendent and uniform, very fast hash functions.","archived":false,"fork":false,"pushed_at":"2018-02-17T17:33:18.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T13:05:45.215Z","etag":null,"topics":["bloom-filter","hash","hash-functions","hashing","nodejs","random","universal-hashing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootslab.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T20:31:07.000Z","updated_at":"2017-12-07T23:20:42.000Z","dependencies_parsed_at":"2022-08-25T06:10:58.379Z","dependency_job_id":null,"html_url":"https://github.com/rootslab/hazz","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/rootslab/hazz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhazz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhazz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhazz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhazz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootslab","download_url":"https://codeload.github.com/rootslab/hazz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fhazz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264786250,"owners_count":23663915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bloom-filter","hash","hash-functions","hashing","nodejs","random","universal-hashing"],"created_at":"2024-10-26T21:32:36.335Z","updated_at":"2025-10-15T20:47:47.296Z","avatar_url":"https://github.com/rootslab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Hazz\n\n[![NPM VERSION](http://img.shields.io/npm/v/hazz.svg?style=flat)](https://www.npmjs.org/package/hazz)\n[![CODACY BADGE](https://img.shields.io/codacy/b18ed7d95b0a4707a0ff7b88b30d3def.svg?style=flat)](https://www.codacy.com/public/44gatti/hazz)\n[![CODECLIMATE-TEST-COVERAGE](https://img.shields.io/codeclimate/c/rootslab/hazz.svg?style=flat)](https://codeclimate.com/github/rootslab/hazz)\n[![LICENSE](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rootslab/hazz#mit-license)\n\n![NODE VERSION](https://img.shields.io/node/v/hazz.svg)\n[![TRAVIS CI BUILD](http://img.shields.io/travis/rootslab/hazz.svg?style=flat)](http://travis-ci.org/rootslab/hazz)\n[![BUILD STATUS](http://img.shields.io/david/rootslab/hazz.svg?style=flat)](https://david-dm.org/rootslab/hazz)\n[![DEVDEPENDENCY STATUS](http://img.shields.io/david/dev/rootslab/hazz.svg?style=flat)](https://david-dm.org/rootslab/hazz#info=devDependencies)\n\n[![NPM MONTHLY](http://img.shields.io/npm/dm/hazz.svg?style=flat)](http://npm-stat.com/charts.html?package=hazz)\n![NPM YEARLY](https://img.shields.io/npm/dy/hazz.svg)\n[![NPM TOTAL](https://img.shields.io/npm/dt/hazz.svg)](http://npm-stat.com/charts.html?package=hazz)\n\n[![NPM GRAPH](https://nodei.co/npm/hazz.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/hazz/)\n\n\u003e __Hazz__, a __pseudo-random-data-filled-table__ to generate __k indipendent__ and __uniform__, __very fast__ (non-cryptographic) hash functions.\n\n\u003e If you need to hash __arbitrary long length__ inputs, without using a fixed (big) size pseudo-random table, a fast way is to __simulate__ a set of indipendent hash functions using a single crpyto-digest (with a sha-512 digest we can simulate up to 16 functions). Take a look to __[Mazz](https://github.com/rootslab/mazz)__ (the fast way of the __tonto__).\n\n### Install\n\n```bash\n$ npm install hazz [-g]\n```\n\n\u003e __require__:\n\n```javascript\nvar Hazz  = require( 'hazz' );\n```\n### Run Tests\n\n\u003e __to run all test files, install devDependencies:__\n\n```bash\n $ cd hazz/\n # install or update devDependencies\n $ npm install \n # run tests\n $ npm test\n```\n\n\u003e __to execute a single test file simply do__:\n\n```bash\n $ node test/file-name.js\n```\n\n### Constructor\n\n\u003e Specify how many bytes to parse (at max), from every\n\u003e input key to hash, then the number of functions to use.\n\n\u003e NOTE: \n\u003e  - default value for input length is 16 byte.\n\u003e  - default and minimum value for hfn is 2\n\n\u003e Arguments between [] are optional.\n\n```javascript\nHazz( [ Number max_input_length [, Number hfn ] ] )\n// or\nnew Hazz( [ Number max_input_length [, Number hfn ] ] )\n```\n\n###  Properties\n\n\n```javascript\n/*\n * the table containing pseudo-random data for generating hash numbers.\n * NOTE: the size of the table is: (max_input_length * hfn) kilobytes,\n * it doesn't depends on the expected population.\n */\nHazz.table\n\n/*\n * max input key length  \n */\nHazz.ilength\n\n/*\n * total number of hash functions  \n */\nHazz.hfn\n```\n\n### Methods\n\n\u003e Arguments between [] are optional.\n\n```javascript\n/*\n * re-fill table with fresh pseudo-random numbers\n */\nHazz#refill() : Hazz\n\n/*\n * Specify a positive integer (from 0 to k-1) to use the k-th\n * hash function. If specified it returns a number within a\n * range.\n * \n * NOTE: \n *  - the input should be a Buffer (no Strings or Arrays).\n *  - the minimum range is obviously 2 (0, 1).\n *  - the integers produced are at min 4 byte long (\u003e= 2^24),\n *    longer the input parsed, bigger the numbers produced.\n */\nHazz#do( Number hfn, Buffer data [, Number range ] ) : Number\n\n/*\n * hash with all functions in parallel,\n * it returns an array of results\n */\nHazz#all( Buffer data [, Number range ] ) : Array\n\n\n```\n\n\u003e See [examples](example/).\n\n### MIT License\n\n\u003e Copyright (c) 2017-present \u0026lt; Guglielmo Ferri : 44gatti@gmail.com \u0026gt;\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining\n\u003e a copy of this software and associated documentation files (the\n\u003e 'Software'), to deal in the Software without restriction, including\n\u003e without limitation the rights to use, copy, modify, merge, publish,\n\u003e distribute, sublicense, and/or sell copies of the Software, and to\n\u003e permit persons to whom the Software is furnished to do so, subject to\n\u003e the following conditions:\n\n\u003e __The above copyright notice and this permission notice shall be\n\u003e included in all copies or substantial portions of the Software.__\n\n\u003e THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n\u003e EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\u003e MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\u003e IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\u003e CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\u003e TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\u003e SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[![GA](https://ga-beacon.appspot.com/UA-53998692-1/hazz/Readme?pixel)](https://github.com/igrigorik/ga-beacon)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fhazz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootslab%2Fhazz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fhazz/lists"}