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
import javax.crypto.Cipher; | |
import javax.crypto.NoSuchPaddingException; | |
import javax.crypto.spec.GCMParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.DataInputStream; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.file.Files; | |
import java.security.InvalidAlgorithmParameterException; |
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
// NOTE: Make sure you set SAMPLES_DAYS: 3650 & LABELS_DAYS: 3650 to avoid the `ALTER TABLE ...` | |
// NOTE: You also need to set "distributed_product_mode" to "global" in your profile. | |
// https://clickhouse.com/docs/en/operations/settings/settings-profiles/ | |
CREATE TABLE qryn.samples_read ( | |
`fingerprint` UInt64, | |
`timestamp_ms` Int64, | |
`value` Float64, | |
`string` String |
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 | |
class VotifierV2 { | |
private $service; | |
private $privateKey; | |
public function __construct($service, $privateKey) { | |
$this->service = $service; | |
$this->privateKey = $privateKey; |
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 | |
$keyPair = openssl_pkey_new(array('private_key_bits' => 2048)); | |
// Private key | |
openssl_pkey_export($keyPair, $privateKey); | |
// Public key | |
$publicKey = openssl_pkey_get_details($keyPair); | |
$publicKey = $publicKey["key"]; |