Socket
Socket
Sign inDemoInstall

@basekits/kit-node-hashing

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @basekits/kit-node-hashing

Hash functions kit for basekits and node runtime.


Version published
Maintainers
1
Install size
6.45 kB
Created

Readme

Source

@basekits/kit-node-hashing

Hash functions kit for basekits and node runtime.

Install

npm i @basekits/kit-node-hashing

Usage

const kit = require('@basekits/core')
const hashing = require('@basekits/kit-node-hashing')
kit.addKit(hashing)

Available Items

The following methods will be available after adding this kit:

.hash(data, algorithm = 'md5')

Returns hash of some data. data can be anything which node's crypto library accepts.

kit.hash('asdfghjklşi') // returns 'e1f301ea36789e07a445c6341bd88cbd'

.hashFile(filepath, algorithm = 'md5')

Returns hash of a file.

kit.hashFile('/path/to/somefile.txt') // returns 'e1f301ea36789e07a445c6341bd88cbd'

.hashcode(str)

Java's hashcode implementation in javascript. (Credits goes to: stackoverflow.com) Returns positive or negative number.

kit.hashcode('hello') // returns 99162322
kit.hashcode('lorem ipsum') // returns -2126368101

Keywords

FAQs

Last updated on 09 Mar 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc