Skip to content

Instantly share code, notes, and snippets.

View Sam-Belliveau's full-sized avatar

Sam Belliveau Sam-Belliveau

  • Cornell University
  • Ithaca, NY
View GitHub Profile
#include <unistd.h>
#include <malloc.h>
int main(){for(;;){fork();void *p=malloc(0x4000);}}
#ifndef SAM_BELLIVEAUS_LAZY_CAST_LIBRARY
#define SAM_BELLIVEAUS_LAZY_CAST_LIBRARY 1
#include <cstdint>
#include <type_traits>
namespace lc {
namespace type {
template<typename T>
@Sam-Belliveau
Sam-Belliveau / GoldenClockFractal.cpp
Last active June 20, 2019 03:11
compile with -> clang++ ClockFractal.cpp -lsfml-graphics -lsfml-window -lsfml-system -O3 -m64
#include <SFML/Graphics.hpp>
#include <utility>
#include <random>
#include <cmath>
using FLOAT = double;
// Used For Speed and fmod
static constexpr FLOAT PI = 3.1415926535897932384626433832795;
static constexpr FLOAT Speed = 2.0*PI/128.0;
@Sam-Belliveau
Sam-Belliveau / xoshiro256.hpp
Last active September 6, 2019 22:57
a c++ implementation of xoshiro256**
#ifndef XOSHIRO_256_RNG_ALGORITHM
#define XOSHIRO_256_RNG_ALGORITHM
#include <random>
#include <cstdint>
#include <limits>
namespace xoshiro256
{
class xoshiro256
import socket
import tkinter as tk
import time
import _thread as thread
from hashlib import blake2b
# Server Constants
STRING_ENCODING = 'utf-8'
# Used so the encryption can keep track of messages
@Sam-Belliveau
Sam-Belliveau / SHA256.py
Last active July 24, 2019 22:06
A Simple SHA256 Implementation in python
from numpy import uint32
from numpy import uint64
from numpy import geterr
from numpy import seterr
class sha256:
STARTING_VALUES = [
uint32(0x6a09e667),
uint32(0xbb67ae85),
@Sam-Belliveau
Sam-Belliveau / SHA1.py
Last active July 24, 2019 22:06
Simple SHA1 Implementation in python
from numpy import uint32
from numpy import uint64
from numpy import geterr
from numpy import seterr
class sha1:
STARTING_VALUES = [
uint32(0x67452301),
uint32(0xEFCDAB89),
import socket
import tkinter as tk
import time
import _thread as thread
from hashlib import blake2b
# Server Constants
STRING_ENCODING = 'utf-8'
# Used so the encryption can keep track of messages
@Sam-Belliveau
Sam-Belliveau / ChaCha.py
Last active August 6, 2019 02:14
Robust Implementation of ChaCha in python that is very extendable, and has the ability to generate high quality random numbers
from numpy import uint32
from numpy import uint64
from numpy import seterr as set_numpy_err
from numpy import geterr as get_numpy_err
class ChaCha:
class ByteSizeError(ValueError):
pass
@Sam-Belliveau
Sam-Belliveau / ChaChaFileEncryptor.py
Last active July 24, 2019 19:06
An encryption algorithm that uses my ChaCha library to calculate the blocks
from ChaCha import ChaCha
from hashlib import blake2s
import os.path as path
from numpy import uint32
from numpy import uint64
import numpy
class ChaCha:
class ByteSizeError(ValueError):