Python study note 4 (guid & UUID)

Source: Internet
Author: User

Confusion between guid and UUID
C # is too deep, so when looking for a way to generate a unique value, it is natural to search for "Python guid ". Poor results. I thought Python didn't generate a method similar to the guid in C. Calm down and look for it carefully. It turned out to be a keyword error. In python, this is called UUID.
Search for this article on Google.ArticleIt seems that the introduction is comprehensive.
Http://www.ietf.org/rfc/rfc4122.txt
Http://mozier.cnblogs.com/archive/2005/01/19/94331.html

There are four UUID types in the python Standard Library:
Uuid1 ([node [, clock_seq]) time-based UUID
Uuid3 (namespace, name) MD5-encrypted UUID
Uuid4 () produces a random UUID
Uuid5 (namespace, name) is based on SHA-1-encrypted UUID

It is strange that there is no uid2. And I don't know if the application fields are different. For me, uuid1 () is currently the most common.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.