<?php

function formatedSize($bytes, $precision = 1)
{
    $units = array('B', 'KB', 'MB', 'GB', 'TB');

    $bytes = max($bytes, 0);
    $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
    $pow = min($pow, count($units) - 1);

    $bytes /= pow(1024, $pow);

    return round($bytes, $precision) . ' ' . $units[$pow];
}

function fcmSpecificUserTopics($userId, $languages)
{
    $topics = array();

    foreach ($languages as $language)
        array_push($topics, 'User_' . $userId . '_' . $language);

    return $topics;
}
function fcmAllUserTopics($languages)
{
    $topics = array();

    foreach ($languages as $language)
        array_push($topics, 'User_' . $language);

    return $topics;
}

function codeGenerator()
{
    //return 44444;
    return  mt_rand(11111, 99999);
}
