Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-05

CreateGUID implementation attached

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Danny Milosavljevic

Hi,

attached you find a CreateGUID implementation that creates (time-based) guids. These follow a low-high approach, with a random part and a time part.

If available, uses libuuid.so.1 and /dev/urandom. Otherwhise uses manual implementation (which sucks - just test by while true ; do ./createguid ; done and behold all the equal guids) as a fallback.

The function should be pretty usable *if* libuuid.so.1 is available, and pretty dangerous if not. I'll not be improving the fallback further though. Someone wants to step in?

cheers,
Danny

www.keyserver.net key id A334AEA6

Reply by email

Michael Van Canneyt
to Danny Milosavljevic
Danny Milosavljevic wrote 13 lines
Hi, attached you find a CreateGUID implementation that creates (time-based) guids. These follow a low-high approach, with a random part and a time part. If available, uses libuuid.so.1 and /dev/urandom. Otherwhise uses manual implementation (which sucks - just test by while true ; do ./createguid ; done and behold all the equal guids) as a fallback. The function should be pretty usable *if* libuuid.so.1 is available, and pretty dangerous if not. I'll not be improving the fallback further though. Someone wants to step in?

You're a bit too late, unfortunately. I have a native object pascal CreateGUID function ready. It mimics libuuid on Linux (uses mac address and time), and uses native windows calls on Win32. For other platforms it uses simply random numbers if no 'real' implementation is available.

I was just waiting for 2.0 to settle down to check it in.

I will do so shortly, so if you're patient, you'll see it appear quite soon.

Michael.

Reply by email

Danny Milosavljevic
to Michael Van Canneyt

Hi,

Michael Van Canneyt wrote 19 lines
On Thu, 19 May 2005, Danny Milosavljevic wrote: > Hi, > > attached you find a CreateGUID implementation that creates (time-based) > guids. These follow a low-high approach, with a random part and a time > part. > > If available, uses libuuid.so.1 and /dev/urandom. Otherwhise uses manual > implementation (which sucks - just test by while true ; > do ./createguid ; done and behold all the equal guids) as a fallback. > > The function should be pretty usable *if* libuuid.so.1 is available, and > pretty dangerous if not. I'll not be improving the fallback further > though. Someone wants to step in? You're a bit too late, unfortunately. I have a native object pascal CreateGUID function ready. It mimics libuuid on Linux (uses mac address and time), and

That's great :)

uses native windows calls on Win32. For other platforms it uses simply random numbers if no 'real' implementation is available. I was just waiting for 2.0 to settle down to check it in.

I see

I will do so shortly, so if you're patient, you'll see it appear quite soon.

okay

Michael.

cheers,
Danny

www.keyserver.net key id A334AEA6

Reply by email

Michael Van Canneyt
to Danny Milosavljevic
Danny Milosavljevic wrote 36 lines
Hi, Am Donnerstag, den 19.05.2005, 19:08 +0200 schrieb Michael Van Canneyt: > > On Thu, 19 May 2005, Danny Milosavljevic wrote: > > > Hi, > > > > attached you find a CreateGUID implementation that creates (time-based) > > guids. These follow a low-high approach, with a random part and a time > > part. > > > > If available, uses libuuid.so.1 and /dev/urandom. Otherwhise uses manual > > implementation (which sucks - just test by while true ; > > do ./createguid ; done and behold all the equal guids) as a fallback. > > > > The function should be pretty usable *if* libuuid.so.1 is available, and > > pretty dangerous if not. I'll not be improving the fallback further > > though. Someone wants to step in? > > You're a bit too late, unfortunately. I have a native object pascal CreateGUID > function ready. It mimics libuuid on Linux (uses mac address and time), and That's great :) > uses native windows calls on Win32. For other platforms it uses simply random > numbers if no 'real' implementation is available. > > I was just waiting for 2.0 to settle down to check it in. I see > > I will do so shortly, so if you're patient, you'll see it appear quite soon. okay

It's committed in SubVersion.

Michael.

Reply by email

Bram Kuijvenhoven
to Michael Van Canneyt
Michael Van Canneyt wrote
It's committed in SubVersion.

SubVersion? The freepascal website still mentions CVS as the protocol by which the latest sources can be obtained? (though I haven't seen any recent changes in the fpc cvs repository) (but I have seen changes in the lazarus cvs repository)

Bram

Reply by email

Marco van de Voort
to Bram Kuijvenhoven
Show quoted text 6 lines
Michael Van Canneyt wrote: > It's committed in SubVersion. SubVersion? The freepascal website still mentions CVS as the protocol by which the latest sources can be obtained? (though I haven't seen any recent changes in the fpc cvs repository) (but I have seen changes in the lazarus cvs repository)

We are migrating to subversion, however there will be a CVS mirror that mirrors SVN in time. So if you are not a committer it won't matter.

There is a page about SVN (and a good one, Peter did a great job with it) in the wiki.

Reply by email

Florian Klaempfl
to Marco van de Voort
Marco van de Voort wrote 7 lines
>Michael Van Canneyt wrote: > >>It's committed in SubVersion. > >SubVersion? The freepascal website still mentions CVS as the protocol by which the latest sources can be obtained? >(though I haven't seen any recent changes in the fpc cvs repository) >(but I have seen changes in the lazarus cvs repository)

For now, you can get the new main branch (2.1.x) from

http://svn.freepascal.org/svn/fpc/trunk/

and the new fixes branch (2.0.x) from
http://svn.freepascal.org/svn/fpc/branches/fixes_2_0/

via subversion.

Show quoted text 11 lines
We are migrating to subversion, however there will be a CVS mirror that mirrors SVN in time. So if you are not a committer it won't matter. There is a page about SVN (and a good one, Peter did a great job with it) in the wiki. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email