Change LZMA expected encoding from HEX to base64, reducing its size

This commit is contained in:
Sandro Santilli
2013-04-19 16:16:20 +02:00
parent 14953e992f
commit f85ca16c62
3 changed files with 8 additions and 20 deletions
+2 -9
View File
@@ -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);