All Projects → karanlyons → Murmurhash3.js

karanlyons / Murmurhash3.js

Licence: mit
MurmurHash3, in JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Labels

Projects that are alternatives of or similar to Murmurhash3.js

Stata Gtools
Faster implementation of Stata's collapse, reshape, xtile, egen, isid, and more using C plugins
Stars: ✭ 108 (-26.53%)
Mutual labels:  hash
Gulp Rev
Static asset revisioning by appending content hash to filenames: `unicorn.css` → `unicorn-d41d8cd98f.css`
Stars: ✭ 1,540 (+947.62%)
Mutual labels:  hash
Imagehash
🌄 Perceptual image hashing for PHP
Stars: ✭ 1,744 (+1086.39%)
Mutual labels:  hash
Node Webcrypto Ossl
A WebCrypto Polyfill for Node in TypeScript built on OpenSSL.
Stars: ✭ 113 (-23.13%)
Mutual labels:  hash
Active hash relation
ActiveHash Relation: Simple gem that allows you to run multiple ActiveRecord::Relation using hash. Perfect for APIs.
Stars: ✭ 115 (-21.77%)
Mutual labels:  hash
Codetective
a tool to determine the crypto/encoding algorithm used according to traces from its representation
Stars: ✭ 121 (-17.69%)
Mutual labels:  hash
Xxhash cpp
Port of the xxhash library to C++17.
Stars: ✭ 106 (-27.89%)
Mutual labels:  hash
React Scrollchor
A React component for scroll to `#hash` links with smooth animations
Stars: ✭ 141 (-4.08%)
Mutual labels:  hash
Digestpp
C++11 header-only message digest library
Stars: ✭ 116 (-21.09%)
Mutual labels:  hash
Webpack Plugin Hash Output
Plugin to replace webpack chunkhash with an md5 hash of the final file conent.
Stars: ✭ 128 (-12.93%)
Mutual labels:  hash
Antidebugging
AntiDebugging sample sources written in C++
Stars: ✭ 114 (-22.45%)
Mutual labels:  hash
Open Crypto
🔑 Hashing (BCrypt, SHA2, HMAC), encryption (AES), public-key (RSA), and random data generation.
Stars: ✭ 115 (-21.77%)
Mutual labels:  hash
Merkle
Node.js module implementing Merkle tree algorithm
Stars: ✭ 123 (-16.33%)
Mutual labels:  hash
Node Sha3
SHA3 for JavaScript - The Keccak family of hash algorithms
Stars: ✭ 112 (-23.81%)
Mutual labels:  hash
Libchaos
Advanced library for randomization, hashing and statistical analysis (devoted to chaos machines). 🔬
Stars: ✭ 1,619 (+1001.36%)
Mutual labels:  hash
Minperf
A Minimal Perfect Hash Function Library
Stars: ✭ 107 (-27.21%)
Mutual labels:  hash
Data Structures
Data-Structures using C++.
Stars: ✭ 121 (-17.69%)
Mutual labels:  hash
Tlsh Js
JavaScript port of TLSH (Trend Micro Locality Sensitive Hash)
Stars: ✭ 143 (-2.72%)
Mutual labels:  hash
Hashlib4pascal
Hashing for Modern Object Pascal
Stars: ✭ 132 (-10.2%)
Mutual labels:  hash
Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (-15.65%)
Mutual labels:  hash

MurmurHash3.js - MurmurHash3, in JavaScript.

NPM Package MIT License Build Status Coverage Status

Usage

> const murmurHash3 = require('murmurhash3.js');

// Return a 32bit hash as an unsigned integer:
> murmurHash3.x86.hash32("I will not buy this record, it is scratched.");
  2832214938

// Return a 128bit hash as a hexadecimal string:
> murmurHash3.x86.hash128("I will not buy this tobacconist's, it is scratched.");
  '9b5b7ba2ef3f7866889adeaf00f3f98e'
> murmurHash3.x64.hash128("I will not buy this tobacconist's, it is scratched.");
  'd30654abbd8227e367d73523f0079673'

// Specify a starting seed (defaults to 0x0):
> murmurHash3.x86.hash32("My hovercraft is full of eels.", 25);
  2520298415

// Hash buffers:
> const buf = new Uint8Array(Array.from({ length: 256}, (_, i) => i));
> murmurHash3.x86.hash32(buf);
  3825864278
> murmurHash3.x86.hash128(buf);
  Uint8Array [44, 86, 200, 143, 219, 69, 3, 223, 211, 82, 178, 26, 73, 76, 162, 192];

// Progressively hash streams of data as either buffers or strings:
> const state32 = murmurHash3.x86.hash32(buf.slice(0, 127), 0x0, false);
> murmurHash3.x86.hash32(buf.slice(127), state32, true);
  3825864278
> const state128 = murmurHash3.x86.hash128(buf.slice(0, 127), 0x0, false);
> murmurHash3.x86.hash128(buf.slice(127), state128, true);
  Uint8Array [44, 86, 200, 143, 219, 69, 3, 223, 211, 82, 178, 26, 73, 76, 162, 192];

API

murmurHash3 = {
  strToBuf: (str: string = ""): Uint8Array,
  bufToHex: (buf: Uint8Array = new Uint8Array(0)): string,
  x86: {
    hash32: (
      buf: Uint8Array | string = new Uint8Array(0),
      state: u32 | x86hash32State = 0x0,
      finalize: boolean = true,
    ): u32 | x86hash32State,
    hash128: (
      buf: Uint8Array | string = new Uint8Array(0),
      state: u32 | x86hash128State = 0x0,
      finalize: boolean = true
    ): Uint8Array | string | x86hash128State,
  },
  x64: {
    hash128: (
      buf: Uint8Array | string = new Uint8Array(0),
      state: u32 | x64hash128State = 0x0,
      finalize: boolean = true
    ): Uint8Array| string | x64hash128State,
  },
}

Requires TextEncoder, Typed Arrays & DataView, and additional es6/es2015 features; bring your own transpiler and polyfills to target the past.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].