๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/ํŒŒ์ด์ฌ

ํŒŒ์ด์ฌ - ์ค‘๋ณต ์—†๋Š” ๊ณ ์œ ์„ฑ์ด ๋ณด์žฅ๋˜๋Š” id ๋งŒ๋“ค๊ธฐ(uuid)

by Janger 2022. 6. 18.
728x90
๋ฐ˜์‘ํ˜•
import uuid
uuid.uuid4() #uuid4 => full random uuid
# Outputs something like: UUID('0172fc9a-1dac-4414-b88d-6b9a6feb91ea')

 

uuid๋ž€ ๊ณ ์œ ์„ฑ์ด ๋ณด์žฅ๋˜๋Š” id๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ ํ‘œ์ค€ ๊ทœ์•ฝ์„ ๋งํ•œ๋‹ค. 

 

์ถœ์ฒ˜: 

https://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits

 

Random string generation with upper case letters and digits

How do I generate a string of size N, made of numbers and uppercase English letters such as: 6U1S75 4Z4UKK U911K4

stackoverflow.com

 

728x90
๋ฐ˜์‘ํ˜•