Commit b268bab8 authored by captainwong's avatar captainwong

test rand

parent d2da3411
...@@ -8,7 +8,8 @@ namespace jlib ...@@ -8,7 +8,8 @@ namespace jlib
{ {
template <class T = std::mt19937, std::size_t N = T::state_size> template <class T = std::mt19937, std::size_t N = T::state_size>
inline auto seeded_random_engine() -> typename std::enable_if<!!N, T>::type { inline typename std::enable_if<!!N, T>::type
seeded_random_engine() {
typename T::result_type random_data[N]; typename T::result_type random_data[N];
std::random_device source; std::random_device source;
std::generate(std::begin(random_data), std::end(random_data), std::ref(source)); std::generate(std::begin(random_data), std::end(random_data), std::ref(source));
......
...@@ -219,6 +219,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_wmi", "test_wmi\test_w ...@@ -219,6 +219,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_wmi", "test_wmi\test_w
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testDeviceUniqueIdentifier", "testDeviceUniqueIdentifier\testDeviceUniqueIdentifier.vcxproj", "{CA7812A3-9E48-4A94-B39A-32EED587E38A}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testDeviceUniqueIdentifier", "testDeviceUniqueIdentifier\testDeviceUniqueIdentifier.vcxproj", "{CA7812A3-9E48-4A94-B39A-32EED587E38A}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "util_tests", "util_tests", "{ABCB8CF8-5E82-4C47-A0FC-E82DF105DF99}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_rand", "test_rand\test_rand.vcxproj", "{4AB0552E-F2D7-4FF0-B019-90D83847A25C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
...@@ -329,6 +333,14 @@ Global ...@@ -329,6 +333,14 @@ Global
{CA7812A3-9E48-4A94-B39A-32EED587E38A}.Release|x64.Build.0 = Release|x64 {CA7812A3-9E48-4A94-B39A-32EED587E38A}.Release|x64.Build.0 = Release|x64
{CA7812A3-9E48-4A94-B39A-32EED587E38A}.Release|x86.ActiveCfg = Release|Win32 {CA7812A3-9E48-4A94-B39A-32EED587E38A}.Release|x86.ActiveCfg = Release|Win32
{CA7812A3-9E48-4A94-B39A-32EED587E38A}.Release|x86.Build.0 = Release|Win32 {CA7812A3-9E48-4A94-B39A-32EED587E38A}.Release|x86.Build.0 = Release|Win32
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Debug|x64.ActiveCfg = Debug|x64
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Debug|x64.Build.0 = Debug|x64
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Debug|x86.ActiveCfg = Debug|Win32
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Debug|x86.Build.0 = Debug|Win32
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Release|x64.ActiveCfg = Release|x64
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Release|x64.Build.0 = Release|x64
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Release|x86.ActiveCfg = Release|Win32
{4AB0552E-F2D7-4FF0-B019-90D83847A25C}.Release|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -358,7 +370,7 @@ Global ...@@ -358,7 +370,7 @@ Global
{823DD7B5-4815-4132-8D28-A5AFBC70DF45} = {513FCA46-EB27-422D-8B65-BAB4AA594D43} {823DD7B5-4815-4132-8D28-A5AFBC70DF45} = {513FCA46-EB27-422D-8B65-BAB4AA594D43}
{41E61D5E-42D7-4EEA-A6B5-3D13DB455848} = {5A2CA1BE-5A4B-41B0-B74A-F86AB433F4A5} {41E61D5E-42D7-4EEA-A6B5-3D13DB455848} = {5A2CA1BE-5A4B-41B0-B74A-F86AB433F4A5}
{F441BB78-6FE1-4FCB-80C3-9FC5F8131996} = {5A2CA1BE-5A4B-41B0-B74A-F86AB433F4A5} {F441BB78-6FE1-4FCB-80C3-9FC5F8131996} = {5A2CA1BE-5A4B-41B0-B74A-F86AB433F4A5}
{175611D7-9C38-4269-B0B4-66DE9555A8EB} = {21DC893D-AB0B-48E1-9E23-069A025218D9} {175611D7-9C38-4269-B0B4-66DE9555A8EB} = {ABCB8CF8-5E82-4C47-A0FC-E82DF105DF99}
{D9BC4E5B-7E8F-4C86-BF15-CCB75CBC256F} = {21DC893D-AB0B-48E1-9E23-069A025218D9} {D9BC4E5B-7E8F-4C86-BF15-CCB75CBC256F} = {21DC893D-AB0B-48E1-9E23-069A025218D9}
{F118E1C9-F461-4CAA-A0F1-75F5A5C8ADF3} = {42703978-A988-403D-9723-E35527FA8A07} {F118E1C9-F461-4CAA-A0F1-75F5A5C8ADF3} = {42703978-A988-403D-9723-E35527FA8A07}
{0E82BB61-0D27-42B4-8F11-98DB2A21C168} = {F118E1C9-F461-4CAA-A0F1-75F5A5C8ADF3} {0E82BB61-0D27-42B4-8F11-98DB2A21C168} = {F118E1C9-F461-4CAA-A0F1-75F5A5C8ADF3}
...@@ -367,6 +379,8 @@ Global ...@@ -367,6 +379,8 @@ Global
{904EC99B-A012-4134-AE6F-E21635FB602F} = {0E6598D3-602D-4552-97F7-DC5AB458D553} {904EC99B-A012-4134-AE6F-E21635FB602F} = {0E6598D3-602D-4552-97F7-DC5AB458D553}
{79A2C0A6-B8BB-406F-A732-C6300A611EC8} = {0E6598D3-602D-4552-97F7-DC5AB458D553} {79A2C0A6-B8BB-406F-A732-C6300A611EC8} = {0E6598D3-602D-4552-97F7-DC5AB458D553}
{CA7812A3-9E48-4A94-B39A-32EED587E38A} = {0E6598D3-602D-4552-97F7-DC5AB458D553} {CA7812A3-9E48-4A94-B39A-32EED587E38A} = {0E6598D3-602D-4552-97F7-DC5AB458D553}
{ABCB8CF8-5E82-4C47-A0FC-E82DF105DF99} = {21DC893D-AB0B-48E1-9E23-069A025218D9}
{4AB0552E-F2D7-4FF0-B019-90D83847A25C} = {ABCB8CF8-5E82-4C47-A0FC-E82DF105DF99}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A8EBEA58-739C-4DED-99C0-239779F57D5D} SolutionGuid = {A8EBEA58-739C-4DED-99C0-239779F57D5D}
......
...@@ -2,19 +2,17 @@ ...@@ -2,19 +2,17 @@
// //
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#include "jlib/chrono_wrapper.h" #include "jlib/util/chrono_wrapper.h"
#include "jlib/dp.h" #include "jlib/dp.h"
#include "jlib/log2.h" #include "jlib/log2.h"
#include "jlib/mem_tool.h" #include "jlib/util/mem_tool.h"
#include "jlib/micro_getter_setter.h" #include "jlib/util/micro_getter_setter.h"
#include "jlib/net.h" //#include "jlib/net.h"
#include "jlib/space.h" #include "jlib/util/space.h"
#include "jlib/std_util.h" #include "jlib/util/std_util.h"
#include "jlib/utf8.h" #include "jlib/utf8.h"
#include "jlib/version_no.h" #include "jlib/util/version_no.h"
#include "jlib/vs_ver.h" //#include "jlib/win32.h"
#include "jlib/win32.h"
#include <jlib/3rdparty/win32/Registry.hpp>
int main() int main()
......
#include "../../jlib/util/rand.h"
#include <stdio.h>
int main()
{
printf("%s\n", jlib::nonce().data());
}
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{4AB0552E-F2D7-4FF0-B019-90D83847A25C}</ProjectGuid>
<RootNamespace>testrand</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="test_rand.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="test_rand.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment