Skip to content

Instantly share code, notes, and snippets.

View plaffitt's full-sized avatar

Paul Laffitte plaffitt

View GitHub Profile
@plaffitt
plaffitt / epochDigest.php
Last active October 11, 2017 08:38
here is the way we compute digests and compare them with the digests compted by Epoch
<?php
public function getDigest($flexpost, $source_encoding=null) {
if ( array_key_exists('epoch_digest', $flexpost) )
unset($flexpost['epoch_digest']);
ksort($flexpost);
$sorted_string = urldecode(strtr(http_build_query($flexpost), ['&' => '', '=' => '']));
if ( $source_encoding )
$sorted_string = mb_convert_encoding($sorted_string, self::UTF8_ENCODING, $source_encoding);
return hash_hmac('md5', $sorted_string, $this->hmac_key);
@plaffitt
plaffitt / install-csfml.sh
Last active June 4, 2023 08:46
CSFML installer for Ubuntu
#!/usr/bin/env bash
set -e
SFML_VERSION='2.2'
GLEW_VERSION='1.10.0'
get_file()
{
local file_to_get="$1"