Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Swift warm up NSUUID
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Johnlin
September 04, 2018
Programming
130
0
Share
Swift warm up NSUUID
Johnlin
September 04, 2018
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
270
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
350
Ruby 型別檢查工具簡介
johnlinvc
0
580
Swift Actor 實作探索
johnlinvc
0
200
用 mruby 來寫跨平台工具
johnlinvc
0
120
Actor model 簡介
johnlinvc
0
230
一起玩 Helm 3
johnlinvc
1
150
為什麼 App 卡卡的
johnlinvc
2
1.3k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
250
Other Decks in Programming
See All in Programming
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
600
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
950
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
450
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
490
Back to the roots of date
jinroq
0
860
cloudnative conference 2026 flyle
azihsoyn
0
180
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
23
13k
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
170
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
290
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
280
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
0
140
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
9
820
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
First, design no harm
axbom
PRO
2
1.2k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
170
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
570
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
300
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
800
Unsuck your backbone
ammeep
672
58k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Transcript
Swift ఔࣜখ NSUUID John Lin
ॄኄੋ UUID • ௨༻།Ұࣝผᛰ(Universally Unique Identifier) • 550e8400-e29b-41d4-a716-446655440000 • 32
ݸ16 ਐҐᏐ= 16byte = 128 bitɼ༗ 3.4 * 10 ^ 38 छ߹
UUID ֨ࣜ • xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx • ࣈᏐత֨ࣜੋ 8-4-4-4-12 • ଖதၷݸํੋ༻ိදࣔ൛ຊతɻ
UUID ൛ຊ • લ༗ޒݸ൛ຊɼၷछᏓᱪɻ • ࠷ৗ༻తੋ 1 4
UUID1 • timestamp (60 bit) + clock_seq(14bit) + version(6bit) +
MAC address(48bit) = 128bit • ࣌ؒੋኺ 1582/10/15T00:00 ։࢝ࢉʢެ㑕։࢝)ɼ 㑌100 ns ࢉҰݸᄸҐ
UUID 䉰 • timestamp (60 bit) + clock_seq(14bit) + version(6bit)
+ MAC address(48bit) = 128bit • ࡏಉҰػث্ɼ100 ಸඵ㚎ᬋػతൣᅴ༗ 14 bit ༗త࣌ީ။㗞ੜҰᒬతUUIDɼҝ䉰
ੜዬ • Ұݸ൝্༗ࡾेݸਓɼ༗ࢸগၷݸਓಉҰఱੜతػ ੋଟগ䏆ʁ • (1/365)^30 ?
ੜዬ • Ұݸ൝্༗ࡾेݸਓɼ༗ࢸগၷݸਓಉҰఱੜతػ ੋଟগ䏆ʁ • ਖ਼֬తࢉ๏ੋ༻ 1 ݮᎃશᔒ༗ॏෳతػɻब ੋ •
ࡏ 30 ݸਓతگԼେੋ 70 %
UUID1 䉰 • timestamp (60 bit) + clock_seq(14bit) + version(6bit)
+ MAC address(48bit) = 128bit • ࡏಉҰػث্ɼ100 ಸඵ㚎ᬋػతൣᅴ༗ 14 bit ༗త࣌ީ။㗞ੜҰᒬతUUIDɼҝ䉰 • ༻ੜዬɼ100 ಸඵ㚎㗞ੜ 18 ݸ UUID ब༗ 1 % తػ။䉰ɼෆଠద߹շ༻
UUID4 • Swift 㚎ݐత NSUUID & UUID ༗ UUID4 •
random (122 bit) + version (6bit) = 128 bit • 䉰తػখଟ • 㗞ੜ 103 ஹݸ UUID4 ။༗ 10ԯ೭Ұతػ။䉰
NSUUID
UUID • ޭೳ NSUUID Ұᒬɼෆաੋ Struct ൛తɻ • ݐٞ༻Ṝݸൺֱ҆શɻ
݁ • UUID 4 䉰తػᕝత • ༗धཁᘐಛ ID త࣌ީब༻㠧ɼൺࣗݾrandom ؆
ᄸɻ
Q&A
፮ᐔػ • http://slot.miario.com/machines/150067