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

keyhasher

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyhasher - npm Package Compare versions

Comparing version 1.3.3 to 1.4.0

index.js

2

package.json
{
"name": "keyhasher",
"version": "1.3.3",
"version": "1.4.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "encrypthashop.js",

@@ -12,3 +12,3 @@ Simple, effective, easy to implement encryption for JavaScript

```javascript
const key = require('keyhasher');
const { encrypt, decrypt, hash } = require('keyhasher');
```

@@ -24,16 +24,16 @@

- use 'hash()' function with a Passcode number, and convert any sentence to encrypted format.
- use 'revHash()' function with the same Passcode number, to get back the Real sentence.
- use 'sha256()' function to finally hash the encrypted value
- use 'encrypt()' function with a Passcode number, and convert any sentence to encrypted format.
- use 'decrypt()' function with the same Passcode number, to get back the Real sentence.
- use 'hash()' function to finally hash the encrypted value, and later compare
```javascript
const key = require('keyhasher');
const { encrypt, decrypt, hash } = require('keyhasher');
var hashAble = key.hash("Normal Sentence", process.env.passcode); // encryption
var hashAble = encrypt("Normal Sentence", process.env.PASSCODE); // encryption
console.log(`Hashed Phrase: ${hashAble}`)
var rawWord = key.revHash("Hashed code", process.env.passcode); // decryption
var rawWord = decrypt("Hashed code", process.env.PASSCODE); // decryption
console.log(`Output: ${rawWord}`)
const hashed = key.sha256(hashAble); // encryption + hashing
const hashed = hash(hashAble); // encryption + hashing
console.log(`Hashed: ${hashed}`)

@@ -46,3 +46,3 @@

var hashAble = key.hash("Hi", 572);
var hashAble = encrypt("Hi", 572);
console.log(`Hashed Phrase: ${hashAble}`)

@@ -52,3 +52,3 @@

var rawWord = key.revHash("X4A=", 572);
var rawWord = decrypt("X4A=", 572);
console.log(`Output: ${rawWord}`)

@@ -58,3 +58,3 @@

const hashed = key.sha256(hashAble);
const hashed = hash(hashAble);
console.log(`Hashed: ${hashed}`)

@@ -61,0 +61,0 @@

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