Skip to content

Commit

Permalink
Use milliseconds intead of seconds when generating ULIDs. Closes #18.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinvdvleuten committed Jul 22, 2019
1 parent fbbe8d3 commit 28dfc92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ulid.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function fromString(string $value, bool $lowercase = false): self

public static function generate(bool $lowercase = false): self
{
$now = (int) microtime(true);
$now = (int) (microtime(true) * 1000);
$duplicateTime = $now === static::$lastGenTime;

static::$lastGenTime = $now;
Expand Down

0 comments on commit 28dfc92

Please sign in to comment.