THIS Python Module Will Make Your Users More UNIQUE!

preview_player
Показать описание
THIS Python module will make your users more unique! #Python. #code
Рекомендации по теме
Комментарии
Автор

My paranoid ass would check for that collision even with <10 users.

callbettersaul
Автор

So when I have 2.7 quantillion users, I will have the problem with duplicate identifiers? Bad

GOLDER-BRAND
Автор

should probably consider using inbuilt functionality in a database for things like this to avoid conflicting ids

matthewbrough
Автор

The UUID should really be the key, since the whole idea of dictionaries is that the key is unique while the value may not be. Right now, if a new user is named Mario, it would just overwrite the first Mario. If you make the ID the key, then generate a new key for every new user, you can have two different users named Mario with separate IDs.

If you don't want users to have name collisions, i.e. you require user names to be unique, then you make that guarantee on creation and so the user name *becomes* the unique ID, eschewing the need for UUID in the first place.

alxjones
Автор

Actually, depending on the condition it can be as low a 1 in 65536. If you are generating multiple uuid at the same time on the same machine, you have a 1 in 65536 of having a collision, since the actual random part is 16 bits long and the rest is generated by the time stamp and some elements identifying the machine.

gavinkemp
Автор

Best way for a company to get out of pay day. "Please can I have your staff number to get your pay cheque"

MatthewSwartIreland
Автор

Youtube needs to let you playlist shorts...

KyXnline
Автор

Used it last time but, the IDs so crazy long, do you know any other ways?

ramialz
Автор

"but it would be much better"

No, it would not.
UUIDs aren't truly unique, need more memory and are slower (usually).

climatechangedoesntbargain
Автор

I've been using it for a while.
The new thing I learned this short is the sep=
Game changer for debugging multiple values bc I can comma seperate them!

deldarel
Автор

this uuid is best for database auto id something like that :-) when having large data

jeodazang
Автор

So they're not gauranteed unique... seems poorly named.

Jugularst
Автор

What I don't understand is why should I be risking this 1 in quintillion chance, when there is no such risk with incremental IDs. I guess it only makes sense if I'm using with small amount of disposable data to lower the amount of stuff you write.

cyberdaniboy
Автор

All great until you generate the same uuid

sushileaderyt
Автор

What if no collision guarantee is required?

ArmaganSalman
Автор

Except I'm a Libra... guaranteed collision.

greycell