<?php

namespace Licenzo\Helper;

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

class Helper
{
    public static function getClientIp($cached = true)
    {
        return IpDetector::getClientIp($cached);
    }

    /**
     * @throws \Exception
     */
    public static function getSessionKey()
    {
        $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;
    }
}
