Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@broofa/fnv1a

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@broofa/fnv1a

A robust, tiny, string hash implementation for JS, based on FNV-1a

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

@broofa/fnv1a

Drop-in replacment for the fnv1a module, with support for unicode and incremental hashing.

See fnv1a module for details

Installation

npm i @broofa/fnv1a

Example: One-time hash

const fnv1a = require('@broofa/fnv1a');

fnv1a('hello world'); // => 2166136261

Example: Incremental hash

const fnv1a = require('@broofa/fnv1a');

const digest = fnv1a.digest();
digest.update('hello');
digest.hash;   // => 1335831723
digest.update(' world');
digest.hash;  // => 2166136261

// Or, more concisely
fnv1a.digest()
  .update('hello');
  .update(' world');
  .hash;  // => 2166136261

Keywords

FAQs

Package last updated on 12 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc