[TOC]
~~~
function randomNumber(length){
length = length || 6
var str = "";
var arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
for(var i=0; i<length; i++){
p= Math.round(Math.random() * (arr.length-1));
str += arr[p];
}
return str;
}
~~~