diff --git a/.gitignore b/.gitignore
index 9cadbfe..30882da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,4 +43,19 @@ local.properties
buck-out/
\.buckd/
*.keystore
-
\ No newline at end of file
+
+#Windows
+.vs/
+packages/
+
+# Files generated by the VS build
+**/Generated Files/**
+
+# Windows Build output folders
+ARM/
+ARM64/
+Debug/
+x64/
+x86/
+bin/
+obj/
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..ac8f08f
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,2 @@
+# Windows solution files
+*.sln
\ No newline at end of file
diff --git a/package.json b/package.json
index 1c7510a..e24d2ff 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,8 @@
"fast-base64-decode": "^1.0.0"
},
"peerDependencies": {
- "react-native": ">=0.56"
+ "react-native": ">=0.56",
+ "react-native-windows": ">=0.64.0"
},
"keywords": [
"Crypto.getRandomValues",
diff --git a/readme.md b/readme.md
index f71d334..c6ff890 100644
--- a/readme.md
+++ b/readme.md
@@ -11,6 +11,18 @@ npx pod-install
> 💡 If you use the Expo managed workflow you will see "CocoaPods is not supported in this project" - this is fine, it's not necessary.
+### Windows
+#### React Native 61
+RNW 61 requires manual linking of the project. To get started:
+ - Open the project solution using Visual Studio.
+ - Right click on the project and select 'Add Existing Item'.
+ - Navigate and select 'windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj'.
+
+#### React Native 63+
+Starting from RNW 63, we now have [support for autolinking](https://microsoft.github.io/react-native-windows/docs/0.63/native-modules-autolinking).
+
+If this does not work you can try [manually autolinking](https://microsoft.github.io/react-native-windows/docs/0.63/native-modules-autolinking#manually-run-autolinking)
+
## Usage
This library works as a polyfill for the global `crypto.getRandomValues`.
diff --git a/windows/.gitignore b/windows/.gitignore
new file mode 100644
index 0000000..4ea0c7b
--- /dev/null
+++ b/windows/.gitignore
@@ -0,0 +1,92 @@
+*AppPackages*
+*BundleArtifacts*
+
+#OS junk files
+[Tt]humbs.db
+*.DS_Store
+
+#Visual Studio files
+*.[Oo]bj
+*.user
+*.aps
+*.pch
+*.vspscc
+*.vssscc
+*_i.c
+*_p.c
+*.ncb
+*.suo
+*.tlb
+*.tlh
+*.bak
+*.[Cc]ache
+*.ilk
+*.log
+*.lib
+*.sbr
+*.sdf
+*.opensdf
+*.opendb
+*.unsuccessfulbuild
+ipch/
+[Oo]bj/
+[Bb]in
+[Dd]ebug*/
+[Rr]elease*/
+Ankh.NoLoad
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+#MonoDevelop
+*.pidb
+*.userprefs
+
+#Tooling
+_ReSharper*/
+*.resharper
+[Tt]est[Rr]esult*
+*.sass-cache
+
+#Project files
+[Bb]uild/
+
+#Subversion files
+.svn
+
+# Office Temp Files
+~$*
+
+# vim Temp Files
+*~
+
+#NuGet
+packages/
+*.nupkg
+
+#ncrunch
+*ncrunch*
+*crunch*.local.xml
+
+# visual studio database projects
+*.dbmdl
+
+#Test files
+*.testsettings
+
+#Other files
+*.DotSettings
+.vs/
+*project.lock.json
+
+#Files generated by the VS build
+**/Generated Files/**
+
diff --git a/windows/ExperimentalFeatures.props b/windows/ExperimentalFeatures.props
new file mode 100644
index 0000000..40a5393
--- /dev/null
+++ b/windows/ExperimentalFeatures.props
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/windows/ReactNativeGetRandomValues.sln b/windows/ReactNativeGetRandomValues.sln
new file mode 100644
index 0000000..831f037
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues.sln
@@ -0,0 +1,156 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29215.179
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeGetRandomValues", "ReactNativeGetRandomValues\ReactNativeGetRandomValues.vcxproj", "{391FC06C-EF10-4401-948E-6F177AFECFBB}"
+ ProjectSection(ProjectDependencies) = postProject
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {F7D32BD0-2749-483E-9A0D-1635EF7E3136}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\node_modules\react-native-windows\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fmt", "..\node_modules\react-native-windows\fmt\fmt.vcxproj", "{14B93DC8-FD93-4A6D-81CB-8BC96644501C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {A990658C-CE31-4BCC-976F-0FC6B1AF693D}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\node_modules\react-native-windows\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\node_modules\react-native-windows\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Shared", "..\node_modules\react-native-windows\Shared\Shared.vcxitems", "{2049DBE9-8D13-42C9-AE4B-413AE38FFFD0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\node_modules\react-native-windows\Mso\Mso.vcxitems", "{84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Include", "..\node_modules\react-native-windows\include\Include.vcxitems", "{EF074BA1-2D54-4D49-A28E-5E040B47CD2E}"
+EndProject
+Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ ..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9
+ ..\node_modules\react-native-windows\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9
+ ..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9
+ ..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
+ ..\node_modules\react-native-windows\include\Include.vcxitems*{ef074ba1-2d54-4d49-a28e-5e040b47cd2e}*SharedItemsImports = 9
+ ..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
+ ..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
+ ..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
+ ..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|ARM64.Build.0 = Debug|ARM64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|x64.ActiveCfg = Debug|x64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|x64.Build.0 = Debug|x64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|x64.Deploy.0 = Debug|x64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|x86.ActiveCfg = Debug|Win32
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|x86.Build.0 = Debug|Win32
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Debug|x86.Deploy.0 = Debug|Win32
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|ARM64.ActiveCfg = Release|ARM64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|ARM64.Build.0 = Release|ARM64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|ARM64.Deploy.0 = Release|ARM64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|x64.ActiveCfg = Release|x64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|x64.Build.0 = Release|x64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|x64.Deploy.0 = Release|x64
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|x86.ActiveCfg = Release|Win32
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|x86.Build.0 = Release|Win32
+ {391FC06C-EF10-4401-948E-6F177AFECFBB}.Release|x86.Deploy.0 = Release|Win32
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|ARM64.Build.0 = Debug|ARM64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.ActiveCfg = Debug|x64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x64.Build.0 = Debug|x64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.ActiveCfg = Debug|Win32
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Build.0 = Debug|Win32
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Debug|x86.Deploy.0 = Debug|Win32
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.ActiveCfg = Release|ARM64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|ARM64.Build.0 = Release|ARM64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.ActiveCfg = Release|x64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x64.Build.0 = Release|x64
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.ActiveCfg = Release|Win32
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Build.0 = Release|Win32
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C}.Release|x86.Deploy.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {2049DBE9-8D13-42C9-AE4B-413AE38FFFD0} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {84E05BFA-CBAF-4F0D-BFB6-4CE85742A57E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {EF074BA1-2D54-4D49-A28E-5E040B47CD2E} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ {14B93DC8-FD93-4A6D-81CB-8BC96644501C} = {5EA20F54-880A-49F3-99FA-4B3FE54E8AB1}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {D43FAD39-F619-437D-BB40-04A3982ACB6A}
+ EndGlobalSection
+EndGlobal
diff --git a/windows/ReactNativeGetRandomValues/PropertySheet.props b/windows/ReactNativeGetRandomValues/PropertySheet.props
new file mode 100644
index 0000000..8510832
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/PropertySheet.props
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.cpp b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.cpp
new file mode 100644
index 0000000..b050a4e
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.cpp
@@ -0,0 +1,11 @@
+#include "pch.h"
+#include "ReactNativeGetRandomValues.h"
+
+namespace winrt::ReactNativeGetRandomValues
+{
+ std::string ReactNativeGetRandomValues::getRandomBase64(int byteLength) noexcept
+ {
+ winrt::Windows::Storage::Streams::IBuffer buffer = winrt::Windows::Security::Cryptography::CryptographicBuffer::GenerateRandom(byteLength);
+ return winrt::to_string(winrt::Windows::Security::Cryptography::CryptographicBuffer::EncodeToBase64String(buffer));
+ }
+}
diff --git a/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.def b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.def
new file mode 100644
index 0000000..24e7c12
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.def
@@ -0,0 +1,3 @@
+EXPORTS
+DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
+DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
diff --git a/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.h b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.h
new file mode 100644
index 0000000..6933a8d
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.h
@@ -0,0 +1,13 @@
+#pragma once
+#include "pch.h"
+#include "NativeModules.h"
+
+namespace winrt::ReactNativeGetRandomValues
+{
+ REACT_MODULE(ReactNativeGetRandomValues, L"RNGetRandomValues");
+ struct ReactNativeGetRandomValues
+ {
+ REACT_SYNC_METHOD(getRandomBase64)
+ std::string getRandomBase64(int byteLength) noexcept;
+ };
+}
diff --git a/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj
new file mode 100644
index 0000000..5319e32
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj
@@ -0,0 +1,158 @@
+
+
+
+
+
+ true
+ true
+ true
+ {391fc06c-ef10-4401-948e-6f177afecfbb}
+ ReactNativeGetRandomValues
+ ReactNativeGetRandomValues
+ en-US
+ 16.0
+ true
+ Windows Store
+ 10.0
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\
+
+
+
+ 10.0.19041.0
+ 10.0.15063.0
+
+
+
+
+ Debug
+ ARM64
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ ARM64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ DynamicLibrary
+ Unicode
+ false
+
+
+ true
+ true
+
+
+ false
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Use
+ pch.h
+ $(IntDir)pch.pch
+ Level4
+ %(AdditionalOptions) /bigobj
+ 4453;28204
+ _WINRT_DLL;%(PreprocessorDefinitions)
+ $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)
+
+
+
+ %(AdditionalOptions) /noattributename
+
+
+ Console
+ true
+ ReactNativeGetRandomValues.def
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+
+
+
+
+
+ ReactPackageProvider.idl
+
+
+
+
+
+ Create
+
+
+
+ ReactPackageProvider.idl
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
\ No newline at end of file
diff --git a/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj.filters b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj.filters
new file mode 100644
index 0000000..c54c4d8
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactNativeGetRandomValues.vcxproj.filters
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/windows/ReactNativeGetRandomValues/ReactPackageProvider.cpp b/windows/ReactNativeGetRandomValues/ReactPackageProvider.cpp
new file mode 100644
index 0000000..73f98dd
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactPackageProvider.cpp
@@ -0,0 +1,19 @@
+#include "pch.h"
+#include "ReactPackageProvider.h"
+#if __has_include("ReactPackageProvider.g.cpp")
+#include "ReactPackageProvider.g.cpp"
+#endif
+#include
+#include "ReactNativeGetRandomValues.h"
+
+using namespace winrt::Microsoft::ReactNative;
+
+namespace winrt::ReactNativeGetRandomValues::implementation
+{
+
+void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept
+{
+ AddAttributedModules(packageBuilder);
+}
+
+} // namespace winrt::ReactNativeGetRandomValues::implementation
diff --git a/windows/ReactNativeGetRandomValues/ReactPackageProvider.h b/windows/ReactNativeGetRandomValues/ReactPackageProvider.h
new file mode 100644
index 0000000..7be7da1
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactPackageProvider.h
@@ -0,0 +1,21 @@
+#pragma once
+#include "ReactPackageProvider.g.h"
+
+using namespace winrt::Microsoft::ReactNative;
+
+namespace winrt::ReactNativeGetRandomValues::implementation
+{
+ struct ReactPackageProvider : ReactPackageProviderT
+ {
+ ReactPackageProvider() = default;
+
+ void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
+ };
+} // namespace winrt::ReactNativeGetRandomValues::implementation
+
+namespace winrt::ReactNativeGetRandomValues::factory_implementation
+{
+
+struct ReactPackageProvider : ReactPackageProviderT {};
+
+} // namespace winrt::ReactNativeGetRandomValues::factory_implementation
diff --git a/windows/ReactNativeGetRandomValues/ReactPackageProvider.idl b/windows/ReactNativeGetRandomValues/ReactPackageProvider.idl
new file mode 100644
index 0000000..c849d9d
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/ReactPackageProvider.idl
@@ -0,0 +1,9 @@
+namespace ReactNativeGetRandomValues
+{
+ [webhosthidden]
+ [default_interface]
+ runtimeclass ReactPackageProvider : Microsoft.ReactNative.IReactPackageProvider
+ {
+ ReactPackageProvider();
+ };
+}
diff --git a/windows/ReactNativeGetRandomValues/packages.config b/windows/ReactNativeGetRandomValues/packages.config
new file mode 100644
index 0000000..c7a3eef
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/windows/ReactNativeGetRandomValues/pch.cpp b/windows/ReactNativeGetRandomValues/pch.cpp
new file mode 100644
index 0000000..bcb5590
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/pch.cpp
@@ -0,0 +1 @@
+#include "pch.h"
diff --git a/windows/ReactNativeGetRandomValues/pch.h b/windows/ReactNativeGetRandomValues/pch.h
new file mode 100644
index 0000000..5c3e7e8
--- /dev/null
+++ b/windows/ReactNativeGetRandomValues/pch.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#define NOMINMAX
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include