Wes
First, random:uniform is not cryptographically secure, which means is
somewhat predictable. As already mentioned use any other generator
meant to be secure as the one in crypto or the ssl library.
Even using a secure pseudrandom generator:
Your first implementation destroys the security, as you are creating a
seed for each random number an attacker just needs to guess the seed
sequence, not the pseudorandom sequence. In your case you had a side
effect of generating collisions, but that was not the worst problem.
The second implementation is more secure in that sense, but still the
original seed is guessable. An attacker can generate possible password
sequences by bruteforce just tying possible now tuples around the time
he thinks the real seed was created.
So, if you want to create passwords difficult to guess, you need at
least a cryptographically secure PRG, which will give you an
unpredictable sequence of bytes, and an unguessable seed, which will
give prevent any attacker from creating the same sequence of bytes
again an completely break all your passwords.
One thing to keep in mind with crypto is that it depends on OpenSSL which means that if you want to create a binary version of your application you need to make sure that the execution platform has OpenSSL.
If you are developing a server for your own use - no problem.
If you want to break the dependency you can - on Un*x-like platforms - resort to getting a seed from /dev/urandom - there is an example of this in https://github.com/lehoff/cryptographic, it is ages since I worked on that and I cannot remember the state of that, but the general principle should be sound.
There is a way to do this in Windows too, but we never got around to implementing that back then.