mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-12-07 11:11:36 +01:00
key in version 2 is raw value instead of base64 (which reduces its complexity), made PasteDecryptor support both versions of the format, refactoring method names, replacing var by let / const, reducing zlib compression level from 9 to 7 to half the time spent on compression
This commit is contained in:
parent
be69e4a50f
commit
0ee86f33da
6 changed files with 301 additions and 318 deletions
|
|
@ -89,6 +89,8 @@ function parseMime(line) {
|
|||
}
|
||||
|
||||
// common testing helper functions
|
||||
exports.atob = atob;
|
||||
exports.btoa = btoa;
|
||||
|
||||
/**
|
||||
* convert all applicable characters to HTML entities
|
||||
|
|
|
|||
595
js/privatebin.js
595
js/privatebin.js
File diff suppressed because it is too large
Load diff
|
|
@ -131,9 +131,9 @@ describe('Model', function () {
|
|||
jsc.nearray(common.jscA2zString()),
|
||||
jsc.nearray(common.jscA2zString()),
|
||||
jsc.array(common.jscQueryString()),
|
||||
jsc.nearray(common.jscBase64String()),
|
||||
'nestring',
|
||||
function (schema, address, query, fragment) {
|
||||
var fragmentString = fragment.join(''),
|
||||
var fragmentString = common.btoa(fragment),
|
||||
clean = jsdom('', {
|
||||
url: schema.join('') + '://' + address.join('') +
|
||||
'/?' + query.join('') + '#' + fragmentString
|
||||
|
|
@ -141,7 +141,7 @@ describe('Model', function () {
|
|||
result = $.PrivateBin.Model.getPasteKey();
|
||||
$.PrivateBin.Model.reset();
|
||||
clean();
|
||||
return fragmentString === result;
|
||||
return fragment === result;
|
||||
}
|
||||
);
|
||||
jsc.property(
|
||||
|
|
@ -149,10 +149,10 @@ describe('Model', function () {
|
|||
jsc.nearray(common.jscA2zString()),
|
||||
jsc.nearray(common.jscA2zString()),
|
||||
jsc.array(common.jscQueryString()),
|
||||
jsc.nearray(common.jscBase64String()),
|
||||
'nestring',
|
||||
jsc.array(common.jscHashString()),
|
||||
function (schema, address, query, fragment, trail) {
|
||||
var fragmentString = fragment.join(''),
|
||||
var fragmentString = common.btoa(fragment),
|
||||
clean = jsdom('', {
|
||||
url: schema.join('') + '://' + address.join('') + '/?' +
|
||||
query.join('') + '#' + fragmentString + '&' + trail.join('')
|
||||
|
|
@ -160,7 +160,7 @@ describe('Model', function () {
|
|||
result = $.PrivateBin.Model.getPasteKey();
|
||||
$.PrivateBin.Model.reset();
|
||||
clean();
|
||||
return fragmentString === result;
|
||||
return fragment === result;
|
||||
}
|
||||
);
|
||||
jsc.property(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ let ret;
|
|||
async function initialize() {
|
||||
if (ret) return ret;
|
||||
|
||||
const COMPRESSION_LEVEL = 9;
|
||||
const COMPRESSION_LEVEL = 7;
|
||||
const NO_ZLIB_HEADER = -1;
|
||||
const CHUNK_SIZE = 32 * 1024;
|
||||
const map = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue