[SOLVED] CS /* Shuffles a 128 kB data buffer 10 times, printing the checksum

$25

File Name: CS_/*_Shuffles_a_128_kB_data_buffer_10_times,_printing_the_checksum.zip
File Size: 631.14 KB

5/5 - (1 vote)

/* Shuffles a 128 kB data buffer 10 times, printing the checksum
after each time. */

#include
#include tests/arc4.h
#include tests/cksum.h
#include tests/lib.h
#include tests/main.h

#define SIZE (128 * 1024)

static char buf[SIZE];

void
test_main (void)
{
size_t i;

/* Initialize. */
for (i = 0; i < sizeof buf; i++)buf[i] = i * 257;msg (“init: cksum=%lu”, cksum (buf, sizeof buf));/* Shuffle repeatedly. */for (i = 0; i < 10; i++){shuffle (buf, sizeof buf, 1);msg (“shuffle %zu: cksum=%lu”, i, cksum (buf, sizeof buf));}}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS /* Shuffles a 128 kB data buffer 10 times, printing the checksum
$25