PHPackages                             nilportugues/uuid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. nilportugues/uuid

ActiveLibrary[Security](/categories/security)

nilportugues/uuid
=================

Library to encapsulate the latest and more secure Uuid versions

1.0.2(10y ago)511.6k1MITPHPPHP &gt;=5.5

Since Feb 14Pushed 9y agoCompare

[ Source](https://github.com/nilportugues/uuid)[ Packagist](https://packagist.org/packages/nilportugues/uuid)[ Docs](http://nilportugues.com)[ RSS](/packages/nilportugues-uuid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (1)

[![Build Status](https://camo.githubusercontent.com/9e77016738e60b82d0a338a8958bf1da82fcf9b7277e6034a4e81e077369e297/68747470733a2f2f7472617669732d63692e6f72672f6e696c706f727475677565732f7068702d757569642e737667)](https://travis-ci.org/nilportugues/php-uuid) [![Coverage Status](https://camo.githubusercontent.com/00c01daca6f629d5ee9899308071938cafc35f4218715c93e143d6565476adc3/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6e696c706f727475677565732f757569642e737667)](https://coveralls.io/r/nilportugues/uuid) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/57c0065b4cd4080f7b376c92a53b70eec13beca763f65ebfe7b221cf31c12672/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e696c706f727475677565732f757569642f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/nilportugues/uuid/) [![Latest Stable Version](https://camo.githubusercontent.com/0e79eceff92b2fbbcc386d933d0f91617ea5301fba98e23868d945820ed78336/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f757569642f762f737461626c65)](https://packagist.org/packages/nilportugues/uuid) [![Total Downloads](https://camo.githubusercontent.com/38614a54e875cd2e5ebcedf80c432a2da93144f5fad7602d295753aea3b99113/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f757569642f646f776e6c6f616473)](https://packagist.org/packages/nilportugues/uuid) [![License](https://camo.githubusercontent.com/0f76821ffabdae9423fc3fcd696029b19f57acc30c8d18fa876b7bd94361fb91/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f757569642f6c6963656e7365)](https://packagist.org/packages/nilportugues/uuid) [![SensioLabsInsight](https://camo.githubusercontent.com/c8321c1abc848ad3b29f63e0041ca6d8fcbd77d22d823d554355f80319d02441/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65653430386530612d356430382d343263652d396634322d6237613532323062313034382f6d696e692e706e67)](https://insight.sensiolabs.com/projects/ee408e0a-5d08-42ce-9f42-b7a5220b1048)[![Donate](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://paypal.me/nilportugues)

Uuid Generator
==============

[](#uuid-generator)

This class' intent is to encapsulate Uuid's latest and more secure versions removing the need to explicitly hard-code a Uuid version everywhere.

### 1. Installation

[](#1-installation)

The recommended way to install the Uuid Generator is through [Composer](http://getcomposer.org). Run the following command to install it:

```
php composer.phar require nilportugues/uuid
```

### 2. Usage

[](#2-usage)

Usage is real simple, you can create your Uuid right away or under certain namespaces.

#### 2.1. Without namespacing

[](#21-without-namespacing)

This is the most common case. Usage is straight-forward:

```
