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

extract-sample

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-sample - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

17

lib/dump-formatter.js

@@ -43,2 +43,11 @@ // Copyright 2014 Cubane Canada

function escapeChar(t) {
if (t === undefined) {
t = ' '.charCodeAt(0);
} else if (t < 32 || t > 127 || t === 92 || t === 34) {
t = '.'.charCodeAt(0);
}
return String.fromCharCode(t);
}
function char16(buffer) {

@@ -49,8 +58,3 @@ var i, a = [], t;

t = buffer.readUInt8(i, true);
if (t === undefined) {
t = ' '.charCodeAt(0);
} else if (t < 32 || t > 127) {
t = '.'.charCodeAt(0);
}
a.push(String.fromCharCode(t));
a.push(escapeChar(t));
}

@@ -101,1 +105,2 @@ return a.join("");

formatDump.c_escape = c_escape;
formatDump.escapeChar = escapeChar;
{
"name": "extract-sample",
"version": "1.1.0",
"version": "1.1.1",
"description": "extract a sample record from a binary file and format as C string",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -122,2 +122,7 @@ /*global describe, it*/

});
it('escapes backslash and quote to dot', function () {
assert.equal(dumpFormatter.escapeChar('\\'.charCodeAt(0)), '.');
assert.equal(dumpFormatter.escapeChar('"'.charCodeAt(0)), '.');
});
});
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