Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift warm up NSUUID
Search
Johnlin
September 04, 2018
Programming
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift warm up NSUUID
Johnlin
September 04, 2018
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
420
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
510
Ruby 型別檢查工具簡介
johnlinvc
0
720
Swift Actor 實作探索
johnlinvc
0
250
用 mruby 來寫跨平台工具
johnlinvc
0
170
Actor model 簡介
johnlinvc
0
310
一起玩 Helm 3
johnlinvc
1
220
為什麼 App 卡卡的
johnlinvc
2
1.4k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
310
Other Decks in Programming
See All in Programming
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
160
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
110
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.2k
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
530
Next.js: The final boss of Web Performance
guaca
0
380
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.7k
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
160
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
280
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
230
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
230
Featured
See All Featured
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
510
Paper Plane
katiecoart
PRO
5
55k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Practical Orchestrator
shlominoach
192
12k
Designing for Timeless Needs
cassininazir
1
550
How GitHub (no longer) Works
holman
316
150k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
520
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
790
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
350
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