rename files
[iotcloud.git] / version2 / src / C / SecureRandom.cpp
diff --git a/version2/src/C/SecureRandom.cpp b/version2/src/C/SecureRandom.cpp
new file mode 100644 (file)
index 0000000..84f40c3
--- /dev/null
@@ -0,0 +1,14 @@
+#include "SecureRandom.h"
+#include <stdlib.h>
+#include <bsd/stdlib.h>
+
+SecureRandom::SecureRandom() {
+}
+
+void SecureRandom::nextBytes(Array<char> *array) {
+       arc4random_buf(array->internalArray(), array->length());
+}
+
+int32_t SecureRandom::nextInt(int32_t val) {
+       return arc4random_uniform(val);
+}