Socket
Socket
Sign inDemoInstall

pvutils

Package Overview
Dependencies
0
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.11 to 1.0.12

13

build/utils.js

@@ -56,3 +56,3 @@ "use strict";

var inputOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var inputLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : inputBuffer.byteLength;
var inputLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : inputBuffer.byteLength - inputOffset;

@@ -136,2 +136,4 @@ var result = "";

if (inputBuffer.length === 1) return inputBuffer[0];
for (var i = inputBuffer.length - 1; i >= 0; i--) {

@@ -150,5 +152,5 @@ result += inputBuffer[inputBuffer.length - 1 - i] * Math.pow(2, inputBase * i);

function utilToBase(value, base) {
var reserved = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
var reserved = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;
var internalReserved = reserved || -1;
var internalReserved = reserved;
var internalValue = value;

@@ -452,2 +454,5 @@

var str = inputNumber.toString(10);
if (fullLength < str.length) return "";
var dif = fullLength - str.length;

@@ -586,3 +591,3 @@

if (nonZeroStart !== -1) output = output.slice(0, nonZeroStart + 1);
if (nonZeroStart !== -1) output = output.slice(0, nonZeroStart + 1);else output = "";
}

@@ -589,0 +594,0 @@

@@ -20,3 +20,4 @@ {

"build": "babel src --compact=false --out-dir build --source-maps",
"watch": "babel src --compact=false --out-dir build --source-maps --watch"
"watch": "babel src --compact=false --out-dir build --source-maps --watch",
"test": "cross-env NODE_ENV=test nyc mocha --require babel-register --require babel-polyfill"
},

@@ -27,7 +28,12 @@ "jsnext:main": "./src/utils.js",

"babel-cli": "latest",
"babel-preset-env": "latest"
"mocha": "^3.0.2",
"nyc": "^11.6.0",
"cross-env": "^5.1.4",
"babel-plugin-istanbul": "^4.1.5",
"babel-preset-env": "latest",
"babel-polyfill": "^6.26.0"
},
"name": "pvutils",
"version": "1.0.11",
"version": "1.0.12",
"license": "MIT"
}
# pvutils
[![CircleCI](https://circleci.com/gh/PeculiarVentures/pvutils.svg?style=svg)](https://circleci.com/gh/PeculiarVentures/pvutils) [![Coverage Status](https://coveralls.io/repos/github/PeculiarVentures/pvutils/badge.svg?branch=master)](https://coveralls.io/github/PeculiarVentures/pvutils?branch=master)
`pvutils` is a set of common utility functions used in various Peculiar Ventures Javascript based projects.

@@ -4,0 +6,0 @@

@@ -36,3 +36,3 @@ //**************************************************************************************

*/
export function bufferToHexCodes(inputBuffer, inputOffset = 0, inputLength = inputBuffer.byteLength)
export function bufferToHexCodes(inputBuffer, inputOffset = 0, inputLength = (inputBuffer.byteLength - inputOffset))
{

@@ -103,2 +103,5 @@ let result = "";

if(inputBuffer.length === 1)
return inputBuffer[0];
for(let i = (inputBuffer.length - 1); i >= 0; i--)

@@ -117,5 +120,5 @@ result += inputBuffer[(inputBuffer.length - 1) - i] * Math.pow(2, inputBase * i);

*/
export function utilToBase(value, base, reserved = 0)
export function utilToBase(value, base, reserved = (-1))
{
const internalReserved = reserved || (-1);
const internalReserved = reserved;
let internalValue = value;

@@ -207,3 +210,2 @@

//region Calculate output length
for(const view of views)

@@ -355,2 +357,6 @@ outputLength += view.length;

const str = inputNumber.toString(10);
if(fullLength < str.length)
return "";
const dif = fullLength - str.length;

@@ -516,2 +522,4 @@

output = output.slice(0, nonZeroStart + 1);
else
output = "";
}

@@ -518,0 +526,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc