<?php
function md5_sign($data, $key, $unset = []) {
    foreach ($unset as $field) {
        unset($data[$field]);
    }

    ksort($data);
    $string = urldecode(http_build_query($data)) . "&key=" . $key;

    return strtoupper(md5($string));
}

function logData($text) {
    file_put_contents(__DIR__ . '/../logs/log.txt', date('[Y-m-d H:i:s] ') . $text . "\n", FILE_APPEND);
}
