81 - Ensuring Uniqueness

This commit is contained in:
Adam Wathan
2017-03-13 18:39:22 -04:00
parent caa215e028
commit ed87106e4d
2 changed files with 15 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ class RandomOrderConfirmationNumberGenerator implements OrderConfirmationNumberG
{
public function generate()
{
return str_repeat('A', 24);
$pool = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
return substr(str_shuffle(str_repeat($pool, 24)), 0, 24);
}
}