core: small improvement in genUID()