- 전체
- Python 일반
- Python 수학
- Python 그래픽
- Python 자료구조
- Python 인공지능
- Python 인터넷
- Python SAGE
- wxPython
- TkInter
- iPython
- wxPython
- pyQT
- Jython
- django
- flask
- blender python scripting
- python for minecraft
- Python 데이터 분석
- Python RPA
- cython
- PyCharm
- pySide
- kivy (python)
Python 자료구조 python으로 GUID 만들기
2019.02.27 15:07
python으로 GUID 만들기
python 2.5이상부터 uuid 모듈을 표준으로 인정했습니다.
- Python 2: http://docs.python.org/2/library/uuid.html
- Python 3: https://docs.python.org/3/library/uuid.html
python3을 기준으로 해석해보면 대략
1. uuid.uuid1(node=None, clock_seq=None)
Generate a UUID from a host ID, sequence number, and the current time. If node is not given, getnode() is used to obtain the hardware address. If clock_seq is given, it is used as the sequence number; otherwise a random 14-bit sequence number is chosen.
host ID, sequence number, 현재 시간을 기준으로 UUID를 생성합니다.
node가 주어지지 않을 경우에는getnode()로 하드웨어의 주소를 얻습니다.clock_seq가 주어진 경우clock_seq를 sequence number로 쓰고 그렇지 않은 경우는 랜덤 14-bit을 만들어냅니다
2. uuid.uuid3(namespace, name)
Generate a UUID based on the MD5 hash of a namespace identifier (which is a UUID) and a name (which is a string).
namespace식별자의 MD5와name을 기준으로 UUID를 생성합니다.
3. uuid.uuid4()
Generate a random UUID.
랜덤 UUID를 생성합니다
4. uuid.uuid5(namespace, name)
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a UUID) and a name (which is a string).
namespace식별자의 SHA-1 해시와name을 기준으로 UUID를 생성합니다.
사용 예 :
>>> import uuid
>>> uuid.uuid4()
UUID('5361a11b-615c-42bf-9bdb-e2c3790ada14')
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 8 |
[python, 그래픽] [파이썬 활용] 마우스 자동화 (pyautogui)
| 졸리운_곰 | 2022.11.26 | 437 |
| 7 |
[python, 그래픽] 파이썬 자동화 툴 - pyautogui 사용하기
| 졸리운_곰 | 2022.11.26 | 568 |
| 6 |
[python][image processing][파이썬][이미지프로세싱] 파이썬 영상 처리 (OpenCV)
| 졸리운_곰 | 2021.11.12 | 629 |
| 5 |
[Python, GUI tool] GUI drag & drop style GUI Builder for Python Tkinter
| 졸리운_곰 | 2021.05.17 | 613 |
| 4 |
[python 파이썬 2d 그래픽스] The Interesting Python Graphics Libraries for Python Programmers
| 졸리운_곰 | 2021.04.27 | 1227 |
| 3 | 파이선 텍스트 게임 샘플 Code for my First Text-Based Game | 졸리운_곰 | 2018.09.01 | 745 |
| 2 |
python Collada dae file Reading : 파이썬으로 콜라다 dae 파일 분석
| 졸리운_곰 | 2017.08.01 | 1065 |
| 1 |
matplotlib으로 하트 그리기
| 졸리운_곰 | 2017.03.04 | 2278 |

