Skip to content

Instantly share code, notes, and snippets.

View opsec-ee's full-sized avatar
👣
Working together

opsec-ee opsec-ee

👣
Working together
  • eSentinel
  • U.S.A
View GitHub Profile
@opsec-ee
opsec-ee / polymorphic.c
Last active September 26, 2025 05:16
Polymorphic Dispatch in C with cJSON
// Copyright (c) 2025 H.Overman <opsec.ee@pm.me>
// JSON Polymorphic Dispatch
// Email: opsec.ee@pm.me
//
// Changelog:
// - Handles actual JSON parsing with minimal overhead
// - Maintains polymorphic dispatch for varied data
// - Zero-copy where possible
// - Computed goto for dispatch
/**
* ISAAC CSPRNG High-Performance Implementation v2.0.0
*
* Based on Bob Jenkins' ISAAC algorithm (1993) - Public Domain
*
* Version: 2.0.0 - H.Overman <opsec.ee@pm.me>
* Date: 2025-01-13
* License: Public Domain (following original ISAAC license)
*/
// Feature test macros for POSIX functions
#define _POSIX_C_SOURCE 200112L
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <time.h>
#include <assert.h>
// https://rosettacode.org/wiki/Huffman_coding - solved in C
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
typedef struct timeval timepoint_t;
static inline timepoint_t get_time(void) {
struct timeval t; gettimeofday(&t, NULL); return t;
}
/*
* Erdős-Selfridge Prime Categorization Engine - C11 Compatible
* Copyright (c) 2025 H.O <opsec.ee@pm.me>
* Target: 10+ million primes/second
* COMPLEXITY: O(n log m) - Near-linear performance
* Where: n = num primes, m = largest prime val
*
* Optimizations:
* - Enhanced wheel factorization with branch elimination
* - Optimized memory layout for cache performance