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

hash-obj

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-obj

Get the hash of an object

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52K
decreased by-26.57%
Maintainers
1
Weekly downloads
 
Created
Source

hash-obj

Get the hash of an object

Install

$ npm install hash-obj

Usage

import hashObject from 'hash-obj';

hashObject({'🦄': '🌈'}, {algorithm: 'sha1'});
//=> '3de3bc784035b559784fc276f47493d60555fba3'

API

hashObject(object, options?)

object

Type: object

options

Type: object

encoding

Type: 'hex' | 'base64' | 'buffer' | 'latin1'
Default: 'hex'

Encoding of the returned hash.

algorithm

Type: string
Default: 'sha512'
Values: 'md5' 'sha1' 'sha256' 'sha512' etc (Platform dependent)

Don't use 'md5' or 'sha1' for anything sensitive. They're insecure.

  • hasha - Hashing made simple. Get the hash of a buffer/string/stream/file.

Keywords

FAQs

Package last updated on 06 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