JavaScript Generate Guid

function GenerateGuid() {

     return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());

}
 

function S4() {

    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);

}

 
Source:

Leave a Reply

Your email address will not be published. Required fields are marked *