public function generateId()
    {
        return sprintf(
            '%08X-%04X-%04X-%02X%02X-%012X',
            mt_rand(),
            mt_rand(0, 65535),
            bindec(substr_replace(
                sprintf('%016b', mt_rand(0, 65535)), '0100', 11, 4)
            ),
            bindec(substr_replace(sprintf('%08b', mt_rand(0, 255)), '01', 5, 2)),
            mt_rand(0, 255),
            mt_rand()
        );
    }
public function generateId()
    {
        return sprintf(
            '%08X-%04X-%04X-%02X%02X-%012X',
            mt_rand(),
            mt_rand(0, 65535),
            bindec(substr_replace(
                sprintf('%016b', mt_rand(0, 65535)), '0100', 11, 4)
            ),
            bindec(substr_replace(sprintf('%08b', mt_rand(0, 255)), '01', 5, 2)),
            mt_rand(0, 255),
            mt_rand()
        );
    }
public function generateId ( ) { return sprintf ( '%08X-%04X-%04X-%02X%02X-%012X' , mt_rand ( ) , mt_rand ( 0 , 65535 ) , bindec ( substr_replace ( sprintf ( '%016b' , mt_rand ( 0 , 65535 ) ) , '0100' , 11 , 4 ) ) , bindec ( substr_replace ( sprintf ( '%08b' , mt_rand ( 0 , 255 ) ) , '01' , 5 , 2 ) ) , mt_rand ( 0 , 255 ) , mt_rand ( ) ) ; }
generate a unique id

Format is: ########-####-####-####-############
Where # is an uppercase letter or number
example: 6D9DC7EC-A273-83A9-ABE3-00005FD752D6

@return string
generate a unique id