Hi Sander! Sander Devrieze schrieb:
...there still is change to have the same value twice. I think it is better to use [EMAIL PROTECTED] as resource. For example: [EMAIL PROTECTED]/[EMAIL PROTECTED]PID of the spawned process that parses the email will work as well.. but someday you may want to run your program on more than one machine ;-)I hear /dev/random is a good alternative to handle this case.
It depends on the number of bits you use to generate the resource. There is a certain probability for calculation errors on a computer. Because of this error probability also in your scheme duplicate IDs may be generated. If the number of random bits is enough to get down to about the same probability for duplicate resources, there is no difference.
Or in other words: yes, random algorithms (of type "Monte Carlo algorithm") may result in wrong results - but deterministic algorithms are not es deterministic as you might expect, if they are executed on real hardware.
So I'd say which way you are using to generate the resources depends on your goals. E.g. you might not want to show IP addresses or PIDs to not leak information about how you set-up your server.
Matthias
smime.p7s
Description: S/MIME Cryptographic Signature