/*!
Theme Name: Edunity
Theme URI: https://techvander.com/edunity/
Author: Ordainit
Author URI: https://themeforest.net/user/ordainit/portfolio
Description: Edunity - University, Online Courses, School & Education WordPress Theme
Version: 1.0.6
License: GNU General Public License
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: edunity
Tags: one-column, right-sidebar, custom-menu, featured-images, post-formats, sticky-post, translation-ready



Tested up to: 5.8
Requires PHP: 7.4


This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
function sign($params, $secret_key) {
    $signed_field_names = explode(",", $params["signed_field_names"]);
    $data_to_sign = [];
    foreach ($signed_field_names as $field) {
        $data_to_sign[] = $field . "=" . $params[$field];
    }
    $data = implode(",", $data_to_sign);
    return base64_encode(hash_hmac('sha256', $data, $secret_key, true));
}
