Adds script/tool to go from lzma base64 encoded string to mapconfig
This commit is contained in:
parent
38e35a6d61
commit
62661c633c
18
scripts/lzma2config.js
Normal file
18
scripts/lzma2config.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
if (process.argv.length !== 3) {
|
||||||
|
console.error('Usage: node %s lzma_string', __filename);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var LZMA = require('lzma').LZMA;
|
||||||
|
var lzmaWorker = new LZMA();
|
||||||
|
var lzmaInput = decodeURIComponent(process.argv[2]);
|
||||||
|
var lzmaBuffer = new Buffer(lzmaInput, 'base64')
|
||||||
|
.toString('binary')
|
||||||
|
.split('')
|
||||||
|
.map(function(c) {
|
||||||
|
return c.charCodeAt(0) - 128
|
||||||
|
});
|
||||||
|
|
||||||
|
lzmaWorker.decompress(lzmaBuffer, function(result) {
|
||||||
|
console.log(JSON.stringify(JSON.parse(JSON.parse(result).config), null, 4));
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user