implementing web crypto API for encryption

This commit is contained in:
El RIDO 2018-09-01 19:42:22 +02:00
parent bd6888687f
commit 0dbbb61d11
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
10 changed files with 280 additions and 80 deletions

View file

@ -213,15 +213,14 @@ describe('Helper', function () {
this.timeout(30000);
jsc.property(
'returns the requested cookie',
'nearray asciinestring',
'nearray asciistring',
jsc.nearray(jsc.nearray(common.jscAlnumString())),
jsc.nearray(jsc.nearray(common.jscAlnumString())),
function (labels, values) {
var selectedKey = '', selectedValue = '',
cookieArray = [];
labels.forEach(function(item, i) {
// deliberatly using a non-ascii key for replacing invalid characters
var key = item.replace(/[\s;,=]/g, Array(i+2).join('£')),
value = (values[i] || values[0]).replace(/[\s;,=]/g, '');
var key = item.join(''),
value = (values[i] || values[0]).join('');
cookieArray.push(key + '=' + value);
if (Math.random() < 1 / i || selectedKey === key)
{