Skip to content

Instantly share code, notes, and snippets.

View CrackerHax's full-sized avatar

MEGACHAD CrackerHax

View GitHub Profile
@CrackerHax
CrackerHax / ecrecover.cpp
Last active June 21, 2023 13:59
C++ ethereum ecRecover function using libsecp256k1 (with recovery module enabled) and keccak-tiny. Returns public eth address from signed message. Used to prove ownership of an eth address for logging in, etc.
#include "keccak-tiny.h"
#include "secp256k1.h"
#include "secp256k1_recovery.h"
std::string bytes_to_hex_string(const uint8_t *str, const uint64_t s)
{
std::ostringstream ret;
for (size_t i = 0; i < s; ++i)
ret << std::hex << std::setfill('0') << std::setw(2) << std::nouppercase << (int) str[i];
@CrackerHax
CrackerHax / create_tfrecord.py
Last active June 3, 2019 13:48
Create tfrecords labeled by category from directories of images
from random import shuffle
import glob
import sys
import cv2
import numpy as np
import tensorflow as tf
name = 'mountains' # name of your project directory where all images are
# should be under ./images/train (or change the path variable below)
image_size = 256 # size of images - should be square images (i.e. 256x256)