Gen HKID
Posted by bunnywong on Saturday, 2 August 2014function gen_hk_id(){var id=parseInt((Math.random()*26)+1);var sum=id*8;id=String.fromCharCode(id+64);for(i=1;i<=6;i++){s=Math.round(Math.random()*9);sum=sum+s*(8-i);id=id+s.toString();}id=id+(11-(sum%11)).toString();return id;} gen_hk_id();