random.h 655 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * @Author : jiejie
  3. * @GitHub : https://github.com/jiejieTop
  4. * @Date : 2021-02-26 12:00:24
  5. * @LastEditors : jiejie
  6. * @LastEditTime : 2022-06-15 19:40:10
  7. * @FilePath : /mqttclient/common/random.h
  8. * Copyright (c) 2022 jiejie, All Rights Reserved. Please keep the author
  9. * information and source code according to the license.
  10. */
  11. #ifndef _RANDOM_H_
  12. #define _RANDOM_H_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define RANDOM_MAX 0x7FFFFFFF
  17. int random_number(void);
  18. int random_number_range(unsigned int min, unsigned int max);
  19. int random_string(char* buffer, int len);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif /* _RANDOM_H_ */