Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 769 Bytes

README.md

File metadata and controls

23 lines (20 loc) · 769 Bytes

liltools

npm npm bundle size Requires.io Libraries.io dependency status for GitHub repo

[TOC]

makeid()

generate random string

function makeid(length) {
    var result           = '';
    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;
    for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * 
 charactersLength));
   }
   return result;
}