Skip to content

Instantly share code, notes, and snippets.

@fod669
fod669 / pcg32.h
Created October 15, 2025 12:03 — forked from mmozeiko/pcg32.h
simple standalone C headers for PCG random number generator
#pragma once
#include <stdint.h>
// pcg32_next() implementation matches pcg_engines::oneseq_xsh_rr_64_32
// NOTE: use this only for compatibility with 32-bit architectures
// otherwise prefer using pcg64.h implementation with 128-bit state
typedef struct {