Page 1 of 1

nuID() - Wiki description

Posted: Tue Aug 18, 2020 2:35 am
by kev1n
Hi,

In contrast to the description, there is no s-prefix added to the Id (which is totally fine with me)

$string = nuID()

Creates a string from

s - Because it was created on the server.
1502690897383 - Date.now().
1012 - An incrementing number looping between 1000 and 9999

https://wiki.nubuilder.cloud/ ... p/PHP#nuID

Re: nuID() - Wiki description

Posted: Fri Aug 21, 2020 3:09 am
by kev1n

Code: Select all

function nuID(){

	$i   = uniqid();
	$s   = md5($i);

    while($i == uniqid()){}

    return uniqid().$s[0].$s[1];

}

Re: nuID() - Wiki description

Posted: Sun Aug 23, 2020 12:52 am
by admin
kev1n,

I have updated the description.

Thanks


Steven