xorshiftrandom.h 776 B

1234567891011121314151617181920212223242526272829
  1. /*******************************************************************************
  2. * Copyright (c) 2017, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. /**
  7. * @file xorshiftrandom.h
  8. *
  9. * The public interface of the XOR shift pseudo-random number generator
  10. */
  11. #include <stdint.h>
  12. #ifndef OPENER_XORSHIFTRANDOM_H_
  13. #define OPENER_XORSHIFTRANDOM_H_
  14. /**
  15. * @brief Sets the initial seed for the XOR shift pseudo-random algorithm
  16. * @param seed The initial seed value
  17. */
  18. void SetXorShiftSeed(uint32_t seed);
  19. /**
  20. * @brief Returns the next generated pseudo-random number
  21. * @return The next pseudo-random number
  22. */
  23. uint32_t NextXorShiftUint32(void);
  24. #endif /* OPENER__XORSHIFTRANDOM_H_ */