Change LZMA expected encoding from HEX to base64, reducing its size
This commit is contained in:
@@ -286,15 +286,8 @@ module.exports = function(){
|
||||
//console.log("type of req.query.lzma is " + typeof(req.query.lzma));
|
||||
//console.log("req.query.lzma is " + req.query.lzma);
|
||||
|
||||
// Decode
|
||||
var lzma = [];
|
||||
for (var i=0; i<req.query.lzma.length/2; ++i) {
|
||||
var hex = req.query.lzma.substring(i*2, i*2+2);
|
||||
var num = parseInt(hex, "16");
|
||||
if ( num > 127 ) num = 127-num;
|
||||
//console.log(i + " hex: " + hex + " decodes as " + num);
|
||||
lzma.push( num );
|
||||
}
|
||||
// Decode (from base64)
|
||||
var lzma = new Buffer(req.query.lzma, 'base64');
|
||||
|
||||
// Decompress
|
||||
//console.log("LZMA decompression starts with " + lzma);
|
||||
|
||||
Reference in New Issue
Block a user