id/misc_functions.php

14 lines
432 B
PHP

<?php
function generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[random_int(0, $charactersLength - 1)];
}
return $randomString;
}
function current_git_commit():string {
return trim(exec("git log --pretty=\"%h\" -n1 HEAD 2>&1"));
}