Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <fcntl.h>
- #define BUFF_CAP 32
- int main(int argc, char** argv)
- {
- int dest = open("/dev/urandom", O_RDWR);
- if (dest == -1)
- {
- perror("Wystapil blad");
- return 1;
- }
- char bytes[BUFF_CAP];
- int bRead = 0;
- bRead = read(dest, bytes, BUFF_CAP);
- int i;
- for(i = 0; i < bRead; i++)
- {
- if ((int)bytes[i] < 0)
- bytes[i] = (int)bytes[i] * -1;
- bytes[i] = bytes[i]%30 + 1;
- printf("%d ", bytes[i]);
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment