Socket
Socket
Sign inDemoInstall

minimalistic-crypto-utils

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

14

lib/utils.js

@@ -16,3 +16,9 @@ 'use strict';

}
if (!enc) {
if (enc === 'hex') {
msg = msg.replace(/[^a-z0-9]+/ig, '');
if (msg.length % 2 !== 0)
msg = '0' + msg;
for (var i = 0; i < msg.length; i += 2)
res.push(parseInt(msg[i] + msg[i + 1], 16));
} else {
for (var i = 0; i < msg.length; i++) {

@@ -27,8 +33,2 @@ var c = msg.charCodeAt(i);

}
} else if (enc === 'hex') {
msg = msg.replace(/[^a-z0-9]+/ig, '');
if (msg.length % 2 !== 0)
msg = '0' + msg;
for (var i = 0; i < msg.length; i += 2)
res.push(parseInt(msg[i] + msg[i + 1], 16));
}

@@ -35,0 +35,0 @@ return res;

{
"name": "minimalistic-crypto-utils",
"version": "1.0.0",
"version": "1.0.1",
"description": "Minimalistic tools for JS crypto modules",

@@ -5,0 +5,0 @@ "main": "lib/utils.js",

@@ -10,2 +10,3 @@ 'use strict';

assert.deepEqual(utils.toArray('1234'), [ 49, 50, 51, 52 ]);
assert.deepEqual(utils.toArray('1234', 'utf8'), [ 49, 50, 51, 52 ]);
assert.deepEqual(utils.toArray('\u1234234'), [ 18, 52, 50, 51, 52 ]);

@@ -12,0 +13,0 @@ assert.deepEqual(utils.toArray([ 1, 2, 3, 4 ]), [ 1, 2, 3, 4 ]);

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