UUID puas muaj kev nyab xeeb?
UUID puas muaj kev nyab xeeb?

Video: UUID puas muaj kev nyab xeeb?

Video: UUID puas muaj kev nyab xeeb?
Video: kev lag luam tiam tshiab 2024, Kaum ib hlis
Anonim

Yog li teb koj cov lus nug: Yog, nws yog nyab xeeb txaus. UUID schemes feem ntau siv tsis yog tsuas yog ib qho pseudo-random caij, tab sis kuj yog lub sijhawm tam sim no, thiab qee yam ntawm cov khoom siv tshwj xeeb ID yog muaj, xws li lub network MAC chaw nyob.

Raws li, UUID cryptographically ruaj ntseg?

UUID stands rau universally unique identifier. A UUID yog 128 khoom lossis 16 bytes lossis 32 tus lej hex. Hauv uuid ua module, muaj ib txoj kev, uuid4(). Yog tias koj xav paub txog kev sib tsoo (lwm lo lus rau kev tsim cov duplicates), qhov yuav muaj tsawg heev: ib qho ntawm 2 ^ 128, tsis txaus los txiav txim siab ruaj ntseg.

Ib yam li ntawd, UUID puas tuaj yeem twv tau? No. Raws li cov UUID spec: Ua tsis xav tias UUIDs nyuaj rau twv ; lawv yuav tsum tsis txhob siv los ua kev muaj peev xwm ruaj ntseg (tus neeg txheeb xyuas uas nws tsuas yog muaj peev xwm nkag tau), piv txwv li. Tsis tas li ntawd, UUIDs tsuas muaj 16 tus cim tau (0 txog F).

Kuj kom paub, koj yuav tsum siv UUID ua tus yuam sij tseem ceeb?

Pros. Siv UUID rau a thawj tus yuam sij nqa cov txiaj ntsig hauv qab no: UUID Qhov tseem ceeb yog tshwj xeeb thoob cov ntxhuav, databases, thiab txawm tias cov servers uas tso cai koj to ua ke kab los ntawm cov databases sib txawv los yog faib cov databases hla servers. UUID tus nqi ua tsis txhob nthuav tawm cov ntaub ntawv hais txog koj cov ntaub ntawv kom lawv muaj kev nyab xeeb dua siv hauv URL.

Puas tau muaj kev sib tsoo UUID?

- Quora. Yog lawm, saib tus account ntawm UUID4 nquag kev sib tsoo UUIDs muaj 122 khoom ntawm entropy yog li lub caij nyoog ntawm ob random UUIDs sib tsoo yog 10^-37. Yog tias koj tsim 2^46 UUIDs (kwv yees li 1 petabyte ntawm entropy) lub caij nyoog tau txais a kev sib tsoo yog 1 ntawm 50 billion.

Pom zoo: