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

@types/object-hash

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/object-hash

TypeScript definitions for object-hash

  • 3.0.6
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
617K
decreased by-13.33%
Maintainers
1
Weekly downloads
 
Created

What is @types/object-hash?

@types/object-hash provides TypeScript type definitions for the object-hash library, which is used to create unique hashes for JavaScript objects. This is useful for tasks such as caching, object comparison, and ensuring data integrity.

What are @types/object-hash's main functionalities?

Basic Hashing

This feature allows you to generate a hash for a simple JavaScript object. The hash can be used to uniquely identify the object.

const objectHash = require('object-hash');
const hash = objectHash({ foo: 'bar' });
console.log(hash);

Hashing with Options

This feature allows you to customize the hashing algorithm and encoding. In this example, the SHA-1 algorithm and hex encoding are used.

const objectHash = require('object-hash');
const hash = objectHash({ foo: 'bar' }, { algorithm: 'sha1', encoding: 'hex' });
console.log(hash);

Hashing Arrays

This feature allows you to generate a hash for an array. The hash will uniquely represent the array's contents.

const objectHash = require('object-hash');
const hash = objectHash([1, 2, 3, 4]);
console.log(hash);

Hashing Nested Objects

This feature allows you to generate a hash for nested objects. The hash will uniquely represent the entire structure of the nested object.

const objectHash = require('object-hash');
const hash = objectHash({ foo: { bar: 'baz' } });
console.log(hash);

Other packages similar to @types/object-hash

FAQs

Package last updated on 07 Nov 2023

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