Skip to content

Instantly share code, notes, and snippets.

View alipha's full-sized avatar

Kevin Spinar alipha

View GitHub Profile
@alipha
alipha / substr.cpp
Created March 14, 2019 14:32
Find all strings in a set which are not a substring of another string within the set
#include <string>
#include <iostream>
#include <fstream>
#include <ctime>
#include <cstring>
#include <set>
#include <algorithm>
using namespace std;
@alipha
alipha / poly_obj.h
Created April 15, 2020 17:39
A class that can store different derived classes with no dynamic allocation and provides value semantics
#ifndef LIPH_POLY_OBJ_H
#define LIPH_POLY_OBJ_H
#include <cstddef>
#include <new>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>

Keybase proof

I hereby claim: * I am alipha on github. * I am spinarkm (https://keybase.io/spinarkm) on keybase. * I have a public key ASDyd4_Nf3Q6AA7EgPxTlnaHfwXnLmY9s4zi9-w71s66oQo To claim this, I am signing this object:

{   "body": {     "key": {       "eldest_kid": "0120f2778fcd7f743a000ec480fc539676877f05e72e663db38ce2f7ec3bd6cebaa10a",       "host": "keybase.io",       "kid": "0120f2778fcd7f743a000ec480fc539676877f05e72e663db38ce2f7ec3bd6cebaa10a",       "uid": "74a6aa21e66c6860d569a3ce80add719",       "username": "spinarkm"     },     "merkle_root": {       "ctime": 1587497015,       "hash": "b4669f65dffcb8b32b99d797233ea2add3791b8eaaae0eb27f304322693df03e6c33f645480c92909b64861bc139f8a5abc166b4e5349daf4ae7ed85df23a83d",       "hash_meta": "847a35f540e081404e3dad0ff6178b69fe3819d7891edccd0ed7097998d0edb1",       "seqno": 16003682     },     "service": {       "entropy": "NuEyPno8PswI0mtmXvgpsaH/",       "name": "github",       "username": "alipha"     },     "type": "web_service_
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.crypto.AEADBadTagException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;