<?php

namespace App\Framework\Ulid;

/**
 * Validiert ULID-Strings.
 */
final readonly class UlidValidator
{
    /**
     * @param string $ulid
     * @return bool true, wenn $ulid exakt 26 Zeichen Crockford-Base32 sind
     */
    public function isValid(string $ulid): bool
    {
        return (bool) preg_match('/^[0-9A-HJKMNP-TV-Z]{26}$/', $ulid);
    }
}
