The following MATLAB script fragment downloads random bytes from a SwiftRNG device on 64-bit Windows. Before using the example, make sure the SwiftRNG device is plugged into an available USB port. A thread-safe and process-safe 64-bit SwiftRNG.dll is included in the software kit.
Note: the following method is deprecated. Use the alternative method described in MATLAB script example for the Windows entropy server.
Sample script fragment for retrieving one random byte
loadlibrary ('.\windows-x64-vs-2019\SwiftRNG.dll', '.\windows-x64-vs-2019\SwiftRNG.h','alias','lib')
b = calllib('lib','swftGetEntropyByteSynchronized')