1 개요[ | ]
- 파이썬 uuid_to_b64uuid(), b64uuid_to_uuid()
Python
Copy
import uuid
def uuid_to_b64uuid( u ):
return uuid.UUID(u).bytes.encode('base64').rstrip('=\n').replace('+','-').replace('/','_')
def b64uuid_to_uuid( b64uuid ):
return uuid.UUID(bytes=(b64uuid.replace('-','+').replace('_','/')+'==').decode('base64'))
print( uuid_to_b64uuid( '71c8851a-9a55-11e4-8e91-7831c1cda656' ) )
print( uuid_to_b64uuid( '11a38b9a-b3da-360f-9353-a5a725514269' ) )
print( uuid_to_b64uuid( '6c18d72a-1b7e-4afa-9bc1-1b1f5d34d7ce' ) )
print( uuid_to_b64uuid( 'c4a760a8-dbcf-5254-a0d9-6a4474bd1b62' ) )
print( uuid_to_b64uuid( '6dff26e7-c476-4483-8c2c-efe3c207a517' ) )
# cciFGppVEeSOkXgxwc2mVg
# EaOLmrPaNg-TU6WnJVFCaQ
# bBjXKht-SvqbwRsfXTTXzg
# xKdgqNvPUlSg2WpEdL0bYg
# bf8m58R2RIOMLO_jwgelFw
print( b64uuid_to_uuid( 'cciFGppVEeSOkXgxwc2mVg' ) )
print( b64uuid_to_uuid( 'EaOLmrPaNg-TU6WnJVFCaQ' ) )
print( b64uuid_to_uuid( 'bBjXKht-SvqbwRsfXTTXzg' ) )
print( b64uuid_to_uuid( 'xKdgqNvPUlSg2WpEdL0bYg' ) )
print( b64uuid_to_uuid( 'bf8m58R2RIOMLO_jwgelFw' ) )
# 71c8851a-9a55-11e4-8e91-7831c1cda656
# 11a38b9a-b3da-360f-9353-a5a725514269
# 6c18d72a-1b7e-4afa-9bc1-1b1f5d34d7ce
# c4a760a8-dbcf-5254-a0d9-6a4474bd1b62
# 6dff26e7-c476-4483-8c2c-efe3c207a517
2 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- Python (25)
리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― Jmnote리눅스 Python 2.7 컴파일 설치 ― ㅇㅇㅇ미운코딩새끼 ― 승호 도령미운코딩새끼 ― 불탄고등어미운코딩새끼 ― 김레이미운코딩새끼 ― 호박이미운코딩새끼 ― Junhg0211미운코딩새끼 ― 김왼손미운코딩새끼 ― 용딘이미운코딩새끼 ―Pinkcrimson
유기농냠냠파이썬 ― 호박유기농냠냠파이썬 ― 이에스유기농냠냠파이썬 ― 이승현파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong