Socket
Socket
Sign inDemoInstall

@confuzzle/readpuz

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@confuzzle/readpuz - npm Package Compare versions

Comparing version 1.0.1 to 1.2.0

4

package.json
{
"name": "@confuzzle/readpuz",
"version": "1.0.1",
"version": "1.2.0",
"description": "Minimal .puz format reader",

@@ -17,4 +17,4 @@ "license": "MIT",

"iconv-lite": "^0.5.2",
"@confuzzle/puz-common": "^1.0.0"
"@confuzzle/puz-common": "^1.2.0"
}
}

@@ -45,2 +45,3 @@ const puz_common = require('@confuzzle/puz-common');

puz[name] = strings[i];
pos += strings[i].length + 1;
}

@@ -54,2 +55,32 @@

/*
* Component Length (bytes) Description
* Title 0x04 The name of the section
* Length 0x02 The length of the data section, in bytes, not counting the null terminator
* Checksum 0x02 A checksum of the data section
* Data variable The data, which varies in format but is always terminated by null and has the specified length
*/
puz.sections = [];
for (let i = 0; i < puz.clues.length; i++) {
pos += puz.clues[i].length + 1;
}
pos += 1;
while ((pos + 8) < buf.length) {
const title = buf.toString('utf8', pos, pos + 4);
const len = buf.readUInt16LE(pos + 4);
const checksum = buf.readUInt16LE(pos + 6);
let data = null;
if (title == 'RTBL' || title == 'LTIM') {
data = buf.toString('utf8', pos + 8, pos + 8 + len);
} else {
data = new Uint8Array(buf.slice(pos + 8, pos + 8 + len));
}
puz.sections.push({
title: title,
data: data,
checksum: checksum
});
pos += 8 + len + 1;
}
return puz;

@@ -56,0 +87,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