Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

nuID() - Wiki description

Questions related to using nuBuilder Forte.
Post Reply
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

nuID() - Wiki description

Unread post 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
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: nuID() - Wiki description

Unread post by kev1n »

Code: Select all

function nuID(){

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

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

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

}
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: nuID() - Wiki description

Unread post by admin »

kev1n,

I have updated the description.

Thanks


Steven
Post Reply