Skip to content

Commit

Permalink
Merge branch 'release/v1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
levidurfee committed Dec 19, 2018
2 parents e065593 + 580ea95 commit 820d931
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/SimpleId.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Bulldog\id;

class SimpleId
{
public static function get()
{
return uniqid().substr(hash('md5', uniqid()), 0, 13);
}
}
6 changes: 6 additions & 0 deletions tests/IdTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,10 @@ public function testIncrementalId()
$this->assertEquals('NAZG9nOQ', $id);
$this->assertEquals('NAZG', $iId->get(4));
}

public function testSimpleId()
{
$id = \Bulldog\id\SimpleId::get();
$this->assertEquals(26, strlen($id));
}
}

0 comments on commit 820d931

Please sign in to comment.