Skip to content

Instantly share code, notes, and snippets.

@menangen
Created March 26, 2020 19:25
Show Gist options
  • Save menangen/b05640e3596bdf2ed325f57757eace26 to your computer and use it in GitHub Desktop.
Save menangen/b05640e3596bdf2ed325f57757eace26 to your computer and use it in GitHub Desktop.
Intel/AMD random Intrinsic
//
// main.c
// rdrand
//
// Created by menangen on 26.03.2020.
// Copyright © 2020 menangen. All rights reserved.
//
#include <stdio.h>
#include <immintrin.h>
int main(int argc, const char * argv[]) {
uint16_t res;
uint8_t i = 0;
while (i < 100) {
_rdrand16_step(&res);
printf("%u\n", res);
i++;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment