fork-openpgpjs/test/general/testInputs.js

18 lines
410 B
JavaScript

/**
* Generates a 50 character long javascript string out of the whole utf-8 range.
*/
function createSomeMessage(){
const length = 50;
let arr = [];
for (let i= 0; i < length; i++){
arr.push(String.fromCharCode(
Math.floor(Math.random() * 10174) + 1));
}
return arr.join('').replace(/\r/g, '\n');
}
module.exports = {
createSomeMessage: createSomeMessage
};