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
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
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 | |
class AesCipher { | |
private const OPENSSL_CIPHER_NAME = "aes-128-cbc"; | |
private const CIPHER_KEY_LEN = 16; //128 bits | |
private static function fixKey($key) { | |
if (strlen($key) < AesCipher::CIPHER_KEY_LEN) { |