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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Johnlin
September 04, 2018
Programming
0
120
Swift warm up NSUUID
Johnlin
September 04, 2018
Tweet
Share
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
220
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
320
Ruby 型別檢查工具簡介
johnlinvc
0
540
Swift Actor 實作探索
johnlinvc
0
180
用 mruby 來寫跨平台工具
johnlinvc
0
100
Actor model 簡介
johnlinvc
0
220
一起玩 Helm 3
johnlinvc
1
140
為什麼 App 卡卡的
johnlinvc
2
1.2k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
230
Other Decks in Programming
See All in Programming
AI時代の認知負荷との向き合い方
optfit
0
130
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
200
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
Architectural Extensions
denyspoltorak
0
260
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
Grafana:建立系統全知視角的捷徑
blueswen
0
320
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
640
SourceGeneratorのススメ
htkym
0
180
今から始めるClaude Code超入門
448jp
7
7.9k
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.4k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
エンジニアに許された特別な時間の終わり
watany
106
230k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
It's Worth the Effort
3n
188
29k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
My Coaching Mixtape
mlcsv
0
45
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
4 Signs Your Business is Dying
shpigford
187
22k
Abbi's Birthday
coloredviolet
1
4.6k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
The Language of Interfaces
destraynor
162
26k
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