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

ohash

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ohash

Super fast hashing library based on murmurhash3 written in Vanilla JS

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5M
increased by0.86%
Maintainers
1
Weekly downloads
 
Created

What is ohash?

The ohash npm package is a utility library for handling objects and hashes in JavaScript. It provides a variety of functions to manipulate and work with objects, including creating hashes, deep cloning, and merging objects.

What are ohash's main functionalities?

Creating hashes from objects

This feature allows you to create a unique hash string from a JavaScript object. It is useful for identifying objects or storing them in a hash table.

const ohash = require('ohash');
const myObject = { name: 'John', age: 30 };
const hash = ohash.hash(myObject);
console.log(hash);

Deep cloning objects

This feature provides a method to create a deep clone of an object, ensuring that nested objects are also cloned rather than just copying references.

const ohash = require('ohash');
const original = { name: 'John', details: { age: 30, city: 'New York' } };
const cloned = ohash.clone(original);
console.log(cloned);

Merging objects

This feature allows you to merge two or more objects into a single object, combining their properties. If properties overlap, the last object's properties will take precedence.

const ohash = require('ohash');
const object1 = { name: 'John' };
const object2 = { age: 30 };
const mergedObject = ohash.merge(object1, object2);
console.log(mergedObject);

Other packages similar to ohash

FAQs

Package last updated on 15 Sep 2024

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