コード例 #1
0
ファイル: get_id_hash.php プロジェクト: ajvarshneya/swaha.me
function get_id_hash($id)
{
    // hash the id
    $hash = hash('sha256', (string) $id);
    // take first 8 characters, convert to int
    $hash_num = hexdec(substr($hash, 0, 8));
    // base62 encode
    $surl = base62_encode($hash_num);
    return $surl;
}
コード例 #2
0
ファイル: NotifySlack.php プロジェクト: ppy/osu-web
 private function replyCommand()
 {
     $topicHash = base62_encode($this->topic->topic_id);
     return "/msg #support !reply {$topicHash} <text>";
 }