This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <memory.h> | |
int* Bubble(int length, int* array) { | |
// Allocate new array and clone it | |
size_t copy_size = sizeof(int) * length; | |
int *array_copy = malloc(copy_size); | |
memcpy(array_copy, array, copy_size); |
This file contains hidden or 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 | |
$encrypted = encryptDecrypt('wiki'); | |
echo "Encrypted: $encrypted\n"; | |
$decrypted = encryptDecrypt($encrypted); | |
echo "Decrypted: $decrypted\n"; | |
function encryptDecrypt($input) { | |
$key = 'C'; | |
$output = ''; | |
for ($i = 0; $i < strlen($input); $i++) { |
This file contains hidden or 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 | |
$text = 'String that will be encrypted'; | |
$password = 'SuperSecretPassword'; | |
$encrypted = encrypt($password, $text); | |
echo "Encrypted text: $encrypted\n"; | |
$decrypted = decrypt($password, $encrypted); | |
echo "Decrypted text: $decrypted\n"; | |
function encrypt($pswd, $text) { |
This file contains hidden or 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('AES_256_CBC', 'aes-256-cbc'); | |
$data = "The string that will be encrypted/decrypted"; | |
$encryption_key = openssl_random_pseudo_bytes(16); // 32 bytes can also be used | |
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(AES_256_CBC)); | |
$encrypted = openssl_encrypt($data, AES_256_CBC, $encryption_key, 0, $iv); | |
echo "Encrypted: $encrypted\n"; |
This file contains hidden or 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 | |
$text = 'Super awesome string that goes through encryption'; | |
$secret = 'D05XC051X1KLRWQ8'; | |
$encrypted = encrypt($text, $secret); | |
echo "Encrypted value: $encrypted\n"; | |
$decrypted = decrypt($encrypted, $secret); | |
echo "Decrypted value: $decrypted\n"; |
This file contains hidden or 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
from PIL import Image, ImageDraw | |
# The RGBA opacity for flag stripes | |
# 0 is the lowest opacity, 255 highest (no opacity at all) | |
rgba_opacity = 155 | |
overlays = { | |
"EST": { | |
"orientation": "horizontal", | |
"colors": [ |
This file contains hidden or 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
from django.core.management.utils import get_random_secret_key | |
get_random_secret_key() |