BilibiliLottery
ZHIHUI抽奖算法
BilibiliLottery
This project implements a fair lottery system using a hash-mapping algorithm. Instead of relying on random number generation that might be predictable or biased, it uses cryptographic hashing—a mathematical technique that converts input data into a unique, unpredictable output. This makes it suitable for raffles, giveaways, or contests where you need to pick winners in a way that's hard to game or manipulate.
The core idea is simple: you feed participant data (like usernames, IDs, or timestamps) into the hashing function, and it deterministically produces a result that determines who wins. Because hash functions have a property called "avalanche effect," even tiny changes in input produce completely different outputs, making it nearly impossible to predict or bias the outcome before running the lottery.
The project includes a ready-to-use Windows program in the dist folder, so you don't need to be a programmer to run it. You can download and execute it directly on your computer without setting up any development environment or dependencies.
This would appeal to content creators on Bilibili (a Chinese video platform) who run fan giveaways, streamers doing viewer lotteries, or anyone running online contests who wants a transparent, tamper-resistant way to select winners. The hash-based approach gives participants confidence that the selection was fair and wasn't secretly manipulated—since the same input always produces the same winner, anyone can verify the result themselves if they have the algorithm and the participant list.
The project is minimal and focused: it does one thing well (fair lottery drawing) and provides a practical tool rather than just theoretical code.