๐Ÿ‘ฉ‍๐Ÿ’ป UUID(Universally Unique IDentifier)๋ž€?

2022. 6. 30. 15:40ใ†Programming/Swift

 

 

 

 UUID๋Š” Universally Unique IDentifier์˜ ์•ฝ์–ด, ๋ฒ”์šฉ ๊ณ ์œ  ์‹๋ณ„์ž

 - UUID ํ‘œ์ค€์— ๋”ฐ๋ผ ์ด๋ฆ„์„ ๋ถ€์—ฌํ•˜๋ฉด ๊ณ ์œ ์„ฑ์„ ์™„๋ฒฝํ•˜๊ฒŒ ๋ณด์žฅํ•  ์ˆ˜๋Š” ์—†์ง€๋งŒ,

์‹ค์ œ ์‚ฌ์šฉ ์ƒ์—์„œ ์ค‘๋ณต๋  ๊ฐ€๋Šฅ์„ฑ์ด ๊ฑฐ์˜ ์—†๋‹ค๊ณ  ์ธ์ •๋˜๊ธฐ ๋•Œ๋ฌธ์— ๋งŽ์ด ์‚ฌ์šฉ

 - UUID๋Š” RFC 4122 ๋ฌธ์„œ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์ƒ์„ฑ

 

 : RFC๋Š” Request for Comments์˜ ์•ฝ์–ด -> ๋น„ํ‰์„ ๊ธฐ๋‹ค๋ฆฌ๋Š” ๋ฌธ์„œ

 - ์ปดํ“จํ„ฐ ๋„คํŠธ์›Œํฌ ๊ณตํ•™ ๋“ฑ์—์„œ ์ธํ„ฐ๋„ท ๊ธฐ์ˆ ์— ์ ์šฉ ๊ฐ€๋Šฅํ•œ ์ƒˆ๋กœ์šด ์—ฐ๊ตฌ, ํ˜์‹ , ๊ธฐ๋ฒ• ๋“ฑ์„ ์•„์šฐ๋ฅด๋Š” ๋ฉ”๋ชจ

 - RFC ํŽธ์ง‘์ž๋Š” ๋งค RFC ๋ฌธ์„œ์— ์ผ๋ จ ๋ฒˆํ˜ธ๋ฅผ ๋ถ€์—ฌ -> ์ผ๋‹จ ์ผ๋ จ ๋ฒˆํ˜ธ๋ฅผ ๋ถ€์—ฌ ๋ฐ›๊ณ  ์ถœํŒ๋˜๋ฉด, RFC๋Š” ์ ˆ๋Œ€ ํ์ง€๋˜๊ฑฐ๋‚˜ ์ˆ˜์ •๋˜์ง€ ์•Š์Œ

 - ๋งŒ์•ฝ ์–ด๋–ค RFC ๋ฌธ์„œ๊ฐ€ ์ˆ˜์ •์ด ํ•„์š”ํ•˜๋‹ค๋ฉด, ์ €์ž๋Š” ์ˆ˜์ •๋œ ๋ฌธ์„œ๋ฅผ ๋‹ค๋ฅธ RFC ๋ฌธ์„œ๋กœ ์žฌ์ถœํŒ

 - ์ด๋Ÿฌํ•œ ๋ฎ์–ด์“ฐ๋Š” ๋ฐฉ์‹์„ ํ†ตํ•ด, ๋ฒˆํ˜ธ ์ˆœ์œผ๋กœ ๋‚˜์—ด๋œ ์ผ๋ จ์˜ RFC, ์ธํ„ฐ๋„ท ํ‘œ์ค€์˜ ์—ญ์‚ฌ๋ฅผ ๋‚˜ํƒ€๋‚ด๊ธฐ๋„ ํ•จ

 

 +  ๋žœ๋ค ๊ฐ’์„ ์ด์šฉํ•ด์„œ UUID๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•

: Creates a UUID with RFC 4122 version 4 random bytes.

 - ์• ํ”Œ ๊ณต์‹ ๋ฌธ์„œ ์ƒ UUID์˜ ์ •์˜

A universally unique value to identify types, interfaces, and other items.

 

 

 

Instance Property uuidString

Returns a string created from the UUID,
such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”

 

 

 

 

 

 ์ถœ์ฒ˜

 1) https://medium.com/@jang.wangsu/ios-swift-uuid๋Š”-์–ด๋–ค-์›๋ฆฌ๋กœ-๋งŒ๋“ค์–ด์ง€๋Š”-๊ฒƒ์ผ๊นŒ-22ec9ff4e792

 2) https://developer.apple.com/documentation/foundation/uuid