Skip to content

Commit

Permalink
Merge pull request #25 from PhpGt/24-deprecation
Browse files Browse the repository at this point in the history
24 deprecation
  • Loading branch information
g105b authored Sep 24, 2022
2 parents f7f8a95 + 80f5008 commit bfd26ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Ulid.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public function getRandomString():string {

private function base32(int $number):string {
$skipCharacters = ["i", "l", "o", "u"];
if($number < 0) {
$number = -$number;
}
$converted = base_convert((string)$number, 10, 32);

for($i = 0, $len = strlen($converted); $i < $len; $i++) {
Expand Down
2 changes: 0 additions & 2 deletions test/phpunit/UlidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function testToString_containsNoAmbiguousCharacters():void {
for($i = 0; $i < 1_000; $i++) {
$sut = new Ulid();
foreach($skipCharacters as $char) {
echo $sut, PHP_EOL;
self::assertStringNotContainsString($char, $sut);
}
}
Expand All @@ -76,7 +75,6 @@ public function testConstruct_setTimestampLength():void {
for($i = 0; $i < 10; $i++) {
$tLength = rand(5, 10);
$sut = new Ulid(timestampLength: $tLength);
echo $sut, PHP_EOL;
$tString = $sut->getTimestampString();
self::assertSame($tLength, strlen($tString));
}
Expand Down

0 comments on commit bfd26ee

Please sign in to comment.