1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef RANDOM 10 #define RANDOM 11 12 #include <random> 13 #include "hdf_base.h" 14 randNum(int32_t min,int32_t max)15int32_t randNum(int32_t min, int32_t max) 16 { 17 std::random_device rd; 18 std::default_random_engine engine(rd()); 19 std::uniform_int_distribution<int32_t> randomNum(min, max); 20 return randomNum(engine); 21 } 22 23 #endif