Random short algorithm implementations in C/C++