edits
[iotcloud.git] / version2 / src / C / SecureRandom.cpp
1 #include "SecureRandom.h"
2 #include <stdlib.h>
3 #include "application.h"
4 //#include <bsd/stdlib.h>
5
6 SecureRandom::SecureRandom() {
7 }
8
9 void SecureRandom::nextBytes(Array<char> *array) {
10         uint len = array->length();
11         for(uint i=0; i<len; i++) {
12                 array->internalArray()[i] = (char) random(256);
13         }
14 }
15
16 int32_t SecureRandom::nextInt(int32_t val) {
17         return random(val);
18 }