SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
UUID
Tomoki Yamashita
2014.4.9 potatotips #6
Self-Introduction
• @tomorrowkey / Tomoki Yamashita
• Android Developer at COOKPAD
• http://blog.tomorrowkey.jp / 明日の
Agenda
• What is UUID?
• How to use it in Java
• Versions of UUID
• Which version can we use in Java
• To use version 1 in Java
• To use version 1 in Android
What is UUID
What is UUID?
• Universally Unique Identifier
• RFC 4122
• Generate Unique ID without servers.
How to use in
Java
How to use it in Java
import java.util.UUID;



public class Main {

public static void main(String... args) {

UUID uuid = UUID.randomUUID();

System.out.println(“uuid=” + uuid.toString());

}

}	
#	
53da3b97-075f-4bcd-af62-148b1a7d6712
Versions of UUID
Versions of UUID
• There are 5 versions of UUID.
Version 1
• Original version
• Use time(nano-seconds) and Mac
Address
• It won't duplicate because depends on
mac address.
Version 2
• Version for DCE(Distributed
Computing Environment) Security
Version 3
• Name and MD5 Hash
• If use the same name, it duplicate.
Version 4
• Random value
• It may not duplicate.
Version 5
• Name and SHA1 Hash
• If use the same name, it duplicate.
Which version can
we use in Java?
Which version can we
use in Java?
• Version 3

UUID.nameUUIDFromBytes(byte[] name)
• Version 4

UUID.randomUUID();
To use version1
in Java
To use version1
in Java
stephenc/eaio-uuid 

https://github.com/stephenc/eaio-uuid
To use version1
in Java
build.gradle

compile ‘com.github.stephenc.eaio-uuid:uuid:3.4.0'	
Main.java

com.eaio.uuid.UUID uuid = new com.eaio.uuid.UUID();

System.out.println(“uuid=” + uuid.toString());
To use version1
in Android
To use version1
in Android
build.gradle

compile ‘com.github.stephenc.eaio-uuid:uuid:3.4.0'	
Main.java

com.eaio.uuid.UUID uuid = new com.eaio.uuid.UUID();

System.out.println(“uuid=” + uuid.toString());
To use version1
in Android
build.gradle

compile ‘com.github.stephenc.eaio-uuid:uuid:3.4.0'	
Main.java

com.eaio.uuid.UUID uuid = new com.eaio.uuid.UUID();

System.out.println(“uuid=” + uuid.toString());
NoClassDefFoundError: com.eaio.uuid.UUID
Why...?
The library use a api which is not
supported in Android.
omg.CORBA.portable.IDLEntity
To use version1
in Android
• clone eaio-uuid
• remove CORBA api from source code.
• add a permission INTERNET
End
Understand principle about UUID and
then use it.
Thank you for listening
Referred links
RFC 4122 - A Universally Unique IDentifier (UUID) URN Namespace 

http://tools.ietf.org/html/rfc4122
Universally unique identifier - Wikipedia, the free encyclopedia 

http://en.wikipedia.org/wiki/UUID#Variants_and_versions
UUIDはなぜ、分散環境で好き勝手に生成しても衝突しないのか。RFC4122規格とUUIDの性質。 ¦ 三
度の飯とエレクトロン 

http://blog.katty.in/5124

Contenu connexe

Similaire à UUID

FLUTTER DHRUVIK.pptx
FLUTTER DHRUVIK.pptxFLUTTER DHRUVIK.pptx
FLUTTER DHRUVIK.pptxssuser5ae1f8
 
20171215 andoird-test-night
20171215 andoird-test-night20171215 andoird-test-night
20171215 andoird-test-nightKazuaki Matsuo
 
Chw00t: How to break out from various chroot solutions
Chw00t: How to break out from various chroot solutionsChw00t: How to break out from various chroot solutions
Chw00t: How to break out from various chroot solutionsBalazs Bucsay
 
What’s new in Sudo 1.8?
What’s new in Sudo 1.8?What’s new in Sudo 1.8?
What’s new in Sudo 1.8?Tyler Reese
 
Puppetcamp East, Windows Without GPOs, John Rogers, SwissRe
Puppetcamp East, Windows Without GPOs, John Rogers, SwissRePuppetcamp East, Windows Without GPOs, John Rogers, SwissRe
Puppetcamp East, Windows Without GPOs, John Rogers, SwissRePuppet
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Mihail Stoynov
 
Eating Fruit - Combining Robots & Apps
Eating Fruit - Combining Robots & AppsEating Fruit - Combining Robots & Apps
Eating Fruit - Combining Robots & AppsRobotGrrl
 
Introducing Ubuntu SDK
Introducing Ubuntu SDKIntroducing Ubuntu SDK
Introducing Ubuntu SDKShuduo Sang
 
Intro to GWT4Touch 2.0
Intro to GWT4Touch 2.0Intro to GWT4Touch 2.0
Intro to GWT4Touch 2.0David La Motta
 
Java overview and architecture
Java overview and architectureJava overview and architecture
Java overview and architectureWeei-Jye Chay
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to AndroidMurat Aydın
 
CNIT 128 6. Analyzing Android Applications (Part 3)
CNIT 128 6. Analyzing Android Applications (Part 3)CNIT 128 6. Analyzing Android Applications (Part 3)
CNIT 128 6. Analyzing Android Applications (Part 3)Sam Bowne
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating SystemAmit Kundu
 
GlobalLogic Education Webinar #6: Challenges of GL Roboclub
GlobalLogic Education Webinar #6: Challenges of GL RoboclubGlobalLogic Education Webinar #6: Challenges of GL Roboclub
GlobalLogic Education Webinar #6: Challenges of GL RoboclubGlobalLogic Ukraine
 

Similaire à UUID (20)

FLUTTER DHRUVIK.pptx
FLUTTER DHRUVIK.pptxFLUTTER DHRUVIK.pptx
FLUTTER DHRUVIK.pptx
 
Arduino
ArduinoArduino
Arduino
 
20171215 andoird-test-night
20171215 andoird-test-night20171215 andoird-test-night
20171215 andoird-test-night
 
Chw00t: How to break out from various chroot solutions
Chw00t: How to break out from various chroot solutionsChw00t: How to break out from various chroot solutions
Chw00t: How to break out from various chroot solutions
 
What’s new in Sudo 1.8?
What’s new in Sudo 1.8?What’s new in Sudo 1.8?
What’s new in Sudo 1.8?
 
Introduction to Frida
Introduction to FridaIntroduction to Frida
Introduction to Frida
 
Puppetcamp East, Windows Without GPOs, John Rogers, SwissRe
Puppetcamp East, Windows Without GPOs, John Rogers, SwissRePuppetcamp East, Windows Without GPOs, John Rogers, SwissRe
Puppetcamp East, Windows Without GPOs, John Rogers, SwissRe
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Eating Fruit - Combining Robots & Apps
Eating Fruit - Combining Robots & AppsEating Fruit - Combining Robots & Apps
Eating Fruit - Combining Robots & Apps
 
Oscon 2010
Oscon 2010Oscon 2010
Oscon 2010
 
Android
AndroidAndroid
Android
 
Introducing Ubuntu SDK
Introducing Ubuntu SDKIntroducing Ubuntu SDK
Introducing Ubuntu SDK
 
Intro to GWT4Touch 2.0
Intro to GWT4Touch 2.0Intro to GWT4Touch 2.0
Intro to GWT4Touch 2.0
 
Java overview and architecture
Java overview and architectureJava overview and architecture
Java overview and architecture
 
Intro google-android
Intro google-androidIntro google-android
Intro google-android
 
Introduction to Android
Introduction to AndroidIntroduction to Android
Introduction to Android
 
CNIT 128 6. Analyzing Android Applications (Part 3)
CNIT 128 6. Analyzing Android Applications (Part 3)CNIT 128 6. Analyzing Android Applications (Part 3)
CNIT 128 6. Analyzing Android Applications (Part 3)
 
Android Operating System
Android Operating SystemAndroid Operating System
Android Operating System
 
A Prelude to Android
A Prelude to AndroidA Prelude to Android
A Prelude to Android
 
GlobalLogic Education Webinar #6: Challenges of GL Roboclub
GlobalLogic Education Webinar #6: Challenges of GL RoboclubGlobalLogic Education Webinar #6: Challenges of GL Roboclub
GlobalLogic Education Webinar #6: Challenges of GL Roboclub
 

Plus de Tomoki YAMASHITA

Few command line tools for help Android development
Few command line tools for help Android developmentFew command line tools for help Android development
Few command line tools for help Android developmentTomoki YAMASHITA
 
ぼくのビルドはにゃあとなく
ぼくのビルドはにゃあとなくぼくのビルドはにゃあとなく
ぼくのビルドはにゃあとなくTomoki YAMASHITA
 
Android Studio Pluginを使ってみた
Android Studio Pluginを使ってみたAndroid Studio Pluginを使ってみた
Android Studio Pluginを使ってみたTomoki YAMASHITA
 
Android SDK Toolsのおさらい
Android SDK ToolsのおさらいAndroid SDK Toolsのおさらい
Android SDK ToolsのおさらいTomoki YAMASHITA
 
Ndefってなんだろう
NdefってなんだろうNdefってなんだろう
NdefってなんだろうTomoki YAMASHITA
 
避けては通れないバイナリ地獄 - NDEFってなんだろう -
避けては通れないバイナリ地獄 - NDEFってなんだろう -避けては通れないバイナリ地獄 - NDEFってなんだろう -
避けては通れないバイナリ地獄 - NDEFってなんだろう -Tomoki YAMASHITA
 
Android NFCアプリハンズオン
Android NFCアプリハンズオンAndroid NFCアプリハンズオン
Android NFCアプリハンズオンTomoki YAMASHITA
 
Dialogを使うときはこうしてます
Dialogを使うときはこうしてますDialogを使うときはこうしてます
Dialogを使うときはこうしてますTomoki YAMASHITA
 

Plus de Tomoki YAMASHITA (10)

Few command line tools for help Android development
Few command line tools for help Android developmentFew command line tools for help Android development
Few command line tools for help Android development
 
ぼくのビルドはにゃあとなく
ぼくのビルドはにゃあとなくぼくのビルドはにゃあとなく
ぼくのビルドはにゃあとなく
 
Android Studio Pluginを使ってみた
Android Studio Pluginを使ってみたAndroid Studio Pluginを使ってみた
Android Studio Pluginを使ってみた
 
Android SDK Toolsのおさらい
Android SDK ToolsのおさらいAndroid SDK Toolsのおさらい
Android SDK Toolsのおさらい
 
What is androider
What is androiderWhat is androider
What is androider
 
Ndefってなんだろう
NdefってなんだろうNdefってなんだろう
Ndefってなんだろう
 
避けては通れないバイナリ地獄 - NDEFってなんだろう -
避けては通れないバイナリ地獄 - NDEFってなんだろう -避けては通れないバイナリ地獄 - NDEFってなんだろう -
避けては通れないバイナリ地獄 - NDEFってなんだろう -
 
Android NFCアプリハンズオン
Android NFCアプリハンズオンAndroid NFCアプリハンズオン
Android NFCアプリハンズオン
 
NFC QUEST作ったよ
NFC QUEST作ったよNFC QUEST作ったよ
NFC QUEST作ったよ
 
Dialogを使うときはこうしてます
Dialogを使うときはこうしてますDialogを使うときはこうしてます
Dialogを使うときはこうしてます
 

Dernier

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Dernier (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

UUID

  • 2. Self-Introduction • @tomorrowkey / Tomoki Yamashita • Android Developer at COOKPAD • http://blog.tomorrowkey.jp / 明日の
  • 3. Agenda • What is UUID? • How to use it in Java • Versions of UUID • Which version can we use in Java • To use version 1 in Java • To use version 1 in Android
  • 5. What is UUID? • Universally Unique Identifier • RFC 4122 • Generate Unique ID without servers.
  • 6. How to use in Java
  • 7. How to use it in Java import java.util.UUID;
 
 public class Main {
 public static void main(String... args) {
 UUID uuid = UUID.randomUUID();
 System.out.println(“uuid=” + uuid.toString());
 }
 } # 53da3b97-075f-4bcd-af62-148b1a7d6712
  • 9. Versions of UUID • There are 5 versions of UUID.
  • 10. Version 1 • Original version • Use time(nano-seconds) and Mac Address • It won't duplicate because depends on mac address.
  • 11. Version 2 • Version for DCE(Distributed Computing Environment) Security
  • 12. Version 3 • Name and MD5 Hash • If use the same name, it duplicate.
  • 13. Version 4 • Random value • It may not duplicate.
  • 14. Version 5 • Name and SHA1 Hash • If use the same name, it duplicate.
  • 15. Which version can we use in Java?
  • 16. Which version can we use in Java? • Version 3
 UUID.nameUUIDFromBytes(byte[] name) • Version 4
 UUID.randomUUID();
  • 18. To use version1 in Java stephenc/eaio-uuid 
 https://github.com/stephenc/eaio-uuid
  • 19. To use version1 in Java build.gradle
 compile ‘com.github.stephenc.eaio-uuid:uuid:3.4.0' Main.java
 com.eaio.uuid.UUID uuid = new com.eaio.uuid.UUID();
 System.out.println(“uuid=” + uuid.toString());
  • 21. To use version1 in Android build.gradle
 compile ‘com.github.stephenc.eaio-uuid:uuid:3.4.0' Main.java
 com.eaio.uuid.UUID uuid = new com.eaio.uuid.UUID();
 System.out.println(“uuid=” + uuid.toString());
  • 22. To use version1 in Android build.gradle
 compile ‘com.github.stephenc.eaio-uuid:uuid:3.4.0' Main.java
 com.eaio.uuid.UUID uuid = new com.eaio.uuid.UUID();
 System.out.println(“uuid=” + uuid.toString()); NoClassDefFoundError: com.eaio.uuid.UUID
  • 23. Why...? The library use a api which is not supported in Android. omg.CORBA.portable.IDLEntity
  • 24. To use version1 in Android • clone eaio-uuid • remove CORBA api from source code. • add a permission INTERNET
  • 25. End Understand principle about UUID and then use it. Thank you for listening
  • 26. Referred links RFC 4122 - A Universally Unique IDentifier (UUID) URN Namespace 
 http://tools.ietf.org/html/rfc4122 Universally unique identifier - Wikipedia, the free encyclopedia 
 http://en.wikipedia.org/wiki/UUID#Variants_and_versions UUIDはなぜ、分散環境で好き勝手に生成しても衝突しないのか。RFC4122規格とUUIDの性質。 ¦ 三 度の飯とエレクトロン 
 http://blog.katty.in/5124