|
Rob, >1) What is z.digit(6)? Looks to me like he is just extracting the 6th, 4th, 5th, and 7th digit of the ten digit result, ie the middle digits, in the above order. So the actual minimum and maximum values seem irrelevant as the pin is derived from x,xx2,314,xxx where 1-4 are the location of the pin digits. I have no idea of the distribution of the resulting PINs across all 86,400 possible timecode "seeds". But this sounds like the type of application which may not need statistically accurate randomness -- I think it depends on how many PINs she is assigning per program invocation. If Debbie is assigning PINs to accounts en masse in batch, then I'd want the millisecond portion of the timestamp or RRN or something used in the algorithm too so that accounts processed sequentially in the same second did not have the same PIN. And I'd care more about testing the real distribution of the PINs. If it is for ad hoc interactive assignment, then it may well be "random" enough. If you only did a few asignments per program invocation, how you choose the seed seems to me more meaningful than the distribution when starting at a given seed. And this algorithm seems at least as good as some methods of choosing a seed for a "true" random number generator. But lest you think Leif doesn't understand random numbers, see Chapter 22 of his book. The chapter title is "How to Generate a Truly Random Number". Doug +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.