New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hubot-hashme

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubot-hashme - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/hashme.js

7

index.js
var fs = require('fs');
var path = require('path');
var dir = path.resolve(__dirname, 'src');
module.exports = function(robot) {
'use strict';
var dir = path.resolve(__dirname, 'src');
fs.exists(dir, function(exists) {

@@ -12,2 +15,2 @@ if (exists) {

});
}
};
{
"name": "hubot-hashme",
"version": "0.1.0",
"version": "0.1.1",
"author": "tgfjt",

@@ -19,9 +19,10 @@ "description": "to create hash with crypto for hubot",

"bugs": {
"email": "fujita@tagpanda.co.jp",
"email": "tgfjt.mail@gmail.com",
"url": "https://github.com/tgfjt/hubot-hashme/issues"
},
"license": "MIT",
"devDependencies": {
"devDependencies": {
"tape": "~2.12.0"
}
},
"dependencies": {}
}

@@ -6,2 +6,3 @@ # hubot-hashme

[![Build Status](https://secure.travis-ci.org/tgfjt/hubot-hashme.png?branch=master)](http://travis-ci.org/tgfjt/hubot-hashme)
[![NPM version](https://badge.fury.io/js/hubot-hashme.png)](http://badge.fury.io/js/hubot-hashme)

@@ -8,0 +9,0 @@

@@ -1,33 +0,11 @@

/**
* Description:
* Hash me!!
*
* Dependencies:
* "crypto": "0.0.3"
*
* Commands:
* hubot hashme <algorithm> <phrase> - to create hash from phrase.
*/
// Description:
// Hash me!!
// Commands:
// hubot hashme <algorithm> <phrase> - to create hash from phrase.
var hashMe = require('../lib/hashme');
var crypto, hashMe;
crypto = require('crypto');
module.exports = function(robot) {
'use strict';
hashMe = function(algorithm, msg) {
var errMsg, hash, hashList;
errMsg = '';
hashList = ['sha1', 'md5', 'sha256', 'sha512'];
if (hashList.indexOf(algorithm) === -1) {
errMsg = 'algorithm should to be... ' + hashList.join(', ');
return errMsg;
}
hash = crypto.createHash(algorithm);
hash.update(msg);
return hash.digest('hex');
};
module.exports = function(robot) {
robot.respond(/hashme (.*) (.*)/i, function(msg) {

@@ -34,0 +12,0 @@ return msg.send(hashMe(msg.match[1], msg.match[2]));

var test = require('tape');
var crypto = require('crypto');
var hashMe = require('../lib/hashme');
var hashMe = function(algorithm, msg) {
var errMsg, hash, hashList;
errMsg = '';
hashList = ['sha1', 'md5', 'sha256', 'sha512'];
if (hashList.indexOf(algorithm) === -1) {
errMsg = 'algorithm should to be... ' + hashList.join(', ');
return errMsg;
}
hash = crypto.createHash(algorithm);
hash.update(msg);
return hash.digest('hex');
};
test('hashme wrong algorithm', function (t) {

@@ -22,0 +7,0 @@ var wrong = hashMe('hoge', '123');

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