| View previous topic :: View next topic |
| Author |
Message |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Fri Oct 10, 2003 6:28 am Post subject: GUID Howto |
|
|
Hi,
I want to use a unique - computer ID for calculating activation keys for my perfect-intranet-app. I like the GUID DSU very much, but I need
to know, how the number is generated, because we need something
similar for Linux/PHP.
Can somebody give some tips for generating unique id's ?
I think mostly registry values are captured, but which are good for
doing this ?
Thanks,
Fabian |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Oct 10, 2003 12:37 pm Post subject: |
|
|
When I run this, I get on 3 consecutive occasions:
| Code: | {A1DACCEB-3272-BB2A-28E0-A005615522DE}
{62B66C71-CA6E-626D-B3EA-E6DB4C3CE14E}
{1B262EBC-ADB2-BDD5-0E0A-CA620ADE3EAA} |
If I close the project and reload, the sequence continues. Whenever I start the IDE and run the script again, the sequence starts from the beginning again. Do other people get the same numbers, or different ones? _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
X-Tools Valued Contributor

Joined: 20 Sep 2001 Posts: 296 Location: Germany
|
Posted: Fri Oct 10, 2003 12:59 pm Post subject: |
|
|
Hi Jules,
you are right - I get exactly the same numbers every time.
Bye, Fabian |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Oct 10, 2003 5:25 pm Post subject: |
|
|
Yes Jules I confirmed it.
I think he is geetting GUID from a given string using API (CLSIDFromString) and changes it (string) by math stores the result in a regkey or something.
BTW lot of privacy issues are involved with GUIDs, gettting even big companies into trouble. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Oct 11, 2003 12:54 pm Post subject: |
|
|
I use the @random function to create the random characters/numbers... I'll have a look at it and update the dsu as soon as possible
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Oct 11, 2003 1:06 pm Post subject: |
|
|
I really don't understand what's going wrong...
Could this bug be caused because VDS doesn't really create random numbers, but just goes thruh a list with previously generated numbers or something like that? I don't know if vds really works like this, but it could be
EDIT:
Try this script:
| Code: |
info @random(0,5)@random(0,5)@random(0,5)
|
run the script, write down the number which is generated, close vds, open the script again, and run it again. And guess which number is returned: the same number! At my computer the first number was 004.
Greetings,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Sat Oct 11, 2003 1:26 pm Post subject: |
|
|
| Vic wrote: | I really don't understand what's going wrong...
Could this bug be caused because VDS doesn't really create random numbers |
No it doesn't. Actually, it uses the Delphi random number function. It does generate a repeatable sequence each time, unless you randomize it first by using the RANDOM command with something like a value obtained from the date and time. Often it is actually useful to have a repeatable (pseudo-)random number sequence.
However, there's a probablility doing it that way you might end up with an ID that isn't globally unique. There are APIs to obtain these numbers which presumably will always produce a unique ID, so that if you use it in your program you won't trash the registration of some COM object or something. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Oct 11, 2003 3:57 pm Post subject: |
|
|
| jules wrote: | | There are APIs to obtain these numbers which presumably will always produce a unique ID, so that if you use it in your program you won't trash the registration of some COM object or something. |
Do you know where I can get those?
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Sat Jan 24, 2004 2:34 pm Post subject: |
|
|
I've updated the GUID dsu... it now generates presumably unique numbers
Regards,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
|