Skip to content

Instantly share code, notes, and snippets.

View Sam-Belliveau's full-sized avatar

Sam Belliveau Sam-Belliveau

View GitHub Profile
@Sam-Belliveau
Sam-Belliveau / eval.hpp
Last active October 10, 2021 20:02
A Infix Notation Evaluator
/**
* MIT License
*
* Copyright (c) Sep 2019, Samuel Robert Belliveau
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@Sam-Belliveau
Sam-Belliveau / ChaCha.hpp
Last active September 26, 2021 20:22
Fast, Secure, Robust, and Documented Implementation of ChaCha for C++. Compatible with the <random> header file and interfaces
/**
* MIT License
*
* Copyright (c) 2021, Samuel Robert Belliveau
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@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
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 / 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),
@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 / 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
@Sam-Belliveau
Sam-Belliveau / ImpossiblePong.cpp
Last active March 21, 2019 18:39
Pong With an Unbeatable Robot. The bot is ment to feel as much like a human as possible. It is also supposed to be as hard as possible. (THAT DOESNT CHEAT)
#include <SFML/Graphics.hpp>
#include <cstdlib>
#include <cmath>
const static float height = 720;
const static float width = 1280;
const static float pHeight = 12;
const static float pWidth = 100;