This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$codes = [ | |
'ab' => 'Abkhazian', | |
'aa' => 'Afar', | |
'af' => 'Afrikaans', | |
'ak' => 'Akan', | |
'sq' => 'Albanian', | |
'am' => 'Amharic', | |
'ar' => 'Arabic', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Base64; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
public class HMAC { | |
public static String hmacDigest(String msg, String keyString, String algo) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("SHARED_SECRET", "sup3rs3cr3t!!"); | |
if(!function_exists('hash_equals')) { | |
function hash_equals($str1, $str2) { | |
// Run constant-time comparison for PHP < 5.6 which doesn't support hmac_equals | |
$str1_len = strlen($str1); | |
$str2_len = strlen($str2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AclComponent using Session Cache for CakePHP 1.3 | |
* | |
* Copyright 2011, nojimage (http://php-tips.com/) | |
* | |
* Licensed under The MIT License | |
* Redistributions of files must retain the above copyright notice. | |
* |