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

enigma-hash

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enigma-hash - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

cli.js

1

index.js

@@ -5,3 +5,2 @@ const crypto = require("crypto")

const algorithms = ["sha256", "sha512"]
const encoding = ["hex", "latin1", "base64"]

@@ -8,0 +7,0 @@

@@ -1,6 +0,8 @@

const {hash} = require('./index')
const { hash } = require("./index")
// sha256 test
test('sha256 hash of Hello World', () => {
expect(hash('Hello World', 'sha256', 'hex')).toEqual("a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e")
test("sha256 hash of Hello World", () => {
expect(hash("Hello World", "sha256", "hex")).toEqual(
"a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"
)
})

@@ -10,14 +12,20 @@

test('sha512 hash of Hello World', () => {
expect(hash('Hello World', 'sha512', 'hex')).toEqual("2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b")
test("sha512 hash of Hello World", () => {
expect(hash("Hello World", "sha512", "hex")).toEqual(
"2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b"
)
})
// hmac sha256 test
test('sha256 Hmac test of Hello World', () => {
expect(hash('Hello World', 'sha256', 'hex', 'Some key')).toEqual("a722630ff96e1aece313dc76a6af89673884bbdb45adec31678f11e44e0578b7")
test("sha256 Hmac test of Hello World", () => {
expect(hash("Hello World", "sha256", "hex", "Some key")).toEqual(
"a722630ff96e1aece313dc76a6af89673884bbdb45adec31678f11e44e0578b7"
)
})
// hmac sha512 test
test('sha256 Hmac test of Hello World', () => {
expect(hash('Hello World', 'sha512', 'hex', 'Some key')).toEqual("8432d61b16b75978b3b8da48a10f44ea72aba3f66f283bdc696dccdff50a897bc946270501e9e4ee122d066b9aef2e60a8789aaf8d636b6a44521ba64371e109")
test("sha256 Hmac test of Hello World", () => {
expect(hash("Hello World", "sha512", "hex", "Some key")).toEqual(
"8432d61b16b75978b3b8da48a10f44ea72aba3f66f283bdc696dccdff50a897bc946270501e9e4ee122d066b9aef2e60a8789aaf8d636b6a44521ba64371e109"
)
})
{
"name": "enigma-hash",
"version": "1.0.2",
"version": "1.1.0",
"description": "Demystifying the hashing of data",

@@ -8,3 +8,3 @@ "main": "index.js",

"test": "jest test",
"format": "prettier --no-semi --tab-width 2 --print-width 100 --write index.js"
"format": "prettier --no-semi --tab-width 2 --print-width 100 --write **/*.js"
},

@@ -40,3 +40,9 @@ "husky": {

"access": "public"
},
"dependencies": {
"colors": "^1.3.3"
},
"bin": {
"enigma": "./cli.js"
}
}

@@ -22,2 +22,3 @@ <div align="center">

- [Usage](#usage)
- [CLI Tool](#cli-tool)
- [Contribute](#contribute)

@@ -100,2 +101,16 @@ - [License](#license)

## CLI Tool
Install with:
```sh
npm install -g enigma-hash
```
& simply run with the following:
```sh
enigma --algorithm sha256 --code hex --input <some string to hash>
```
## Contribute

@@ -102,0 +117,0 @@

Sorry, the diff of this file is not supported yet

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