<?php

namespace ZenoChatbot\Helper;

class SessionKeyGenerator
{
    /**
     * Generate a secure alphanumeric session ID.
     *
     * Only [a-z0-9] characters, no special chars or separators.
     *
     * @return string
     * @throws \Exception
     */
    public static function generateSessionId(): string
    {
        $uniq   = uniqid();                     // 13 hex chars
        $time   = base_convert(time(), 10, 36); // alphanumeric timestamp
        $random = bin2hex(random_bytes(8));     // 16 hex chars

        return $uniq . $time . $random;
    }
}
