Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function randomNum(from, to) {
- return from + Math.floor( Math.random() * (to - from + 1) );
- }
- function randomChar(length){
- var library = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
- var res = '';
- for(var i=0; i<length; i++){
- res = [res, library[randomNum(0,9)]].join('');
- }
- return res;
- }
- // randomChar(140)
Add Comment
Please, Sign In to add comment