Socket
Socket
Sign inDemoInstall

utility

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utility - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

5

History.md
1.3.1 / 2015-04-09
==================
* fix(crypto): base64decode support return buffer
1.3.0 / 2015-01-31

@@ -3,0 +8,0 @@ ==================

14

lib/crypto.js

@@ -108,10 +108,14 @@ /*!

* which substitutes - instead of + and _ instead of / in the standard Base64 alphabet.
* @return {String} plain text.
* @param {encoding} [encoding=utf8] if encoding = buffer, will return Buffer instance
* @return {String|Buffer} plain text.
*/
exports.base64decode = function base64decode(encode, urlsafe) {
exports.base64decode = function base64decode(encodeStr, urlsafe, encoding) {
if (urlsafe) {
encode = encode.replace(/\-/g, '+').replace(/_/g, '/');
encodeStr = encodeStr.replace(/\-/g, '+').replace(/_/g, '/');
}
encode = new Buffer(encode, 'base64');
return encode.toString();
var buf = new Buffer(encodeStr, 'base64');
if (encoding === 'buffer') {
return buf;
}
return buf.toString(encoding || 'utf8');
};

@@ -118,0 +122,0 @@

{
"name": "utility",
"version": "1.3.0",
"version": "1.3.1",
"description": "A collection of useful utilities.",

@@ -42,3 +42,3 @@ "main": "lib/utility.js",

"keywords": [
"utility"
"utility", "util", "utils"
],

@@ -48,4 +48,4 @@ "engines": {

},
"author": "fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com)",
"author": "fengmk2 <fengmk2@gmail.com> (http://fengmk2.com)",
"license": "MIT"
}

@@ -8,2 +8,3 @@ utility

[![Gittip][gittip-image]][gittip-url]
[![io.js version][iojs-image]][iojs-url]
[![node version][node-image]][node-url]

@@ -21,3 +22,5 @@ [![npm download][download-image]][download-url]

[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[node-url]: https://nodejs.org/download/
[iojs-image]: https://img.shields.io/badge/io.js-%3E=_1.0-yellow.svg?style=flat-square
[iojs-url]: https://iojs.org/
[download-image]: https://img.shields.io/npm/dm/utility.svg?style=flat-square

@@ -24,0 +27,0 @@ [download-url]: https://npmjs.org/package/utility

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