Chromium Code Reviews| Index: webrtc/base/helpers.h |
| diff --git a/webrtc/base/helpers.h b/webrtc/base/helpers.h |
| index 0e7937362a334c7cc29bc9a3ff203c1f7fec647c..6356a85fa1e0303cbcf1736e735c498df8906272 100644 |
| --- a/webrtc/base/helpers.h |
| +++ b/webrtc/base/helpers.h |
| @@ -25,7 +25,7 @@ bool InitRandom(const char* seed, size_t len); |
| // Generates a (cryptographically) random string of the given length. |
| // We generate base64 values so that they will be printable. |
| -// WARNING: could silently fail. Use the version below instead. |
| +// WARNING: will abort() if the RNG fails! Use the version below instead. |
| std::string CreateRandomString(size_t length); |
| // Generates a (cryptographically) random string of the given length. |
| @@ -40,20 +40,40 @@ bool CreateRandomString(size_t length, const std::string& table, |
| std::string* str); |
| // Generates a (cryptographically) random UUID version 4 string. |
| +// WARNING: will abort() if the RNG fails! Use the version below instead. |
|
mattdr-at-webrtc.org
2016/07/01 23:57:39
Suggest removing these warnings. The RNG will almo
joachim
2016/07/02 00:12:01
Done.
|
| std::string CreateRandomUuid(); |
| +// Generates a (cryptographically) random UUID version 4 string. |
| +bool CreateRandomUuid(std::string* uuid); |
|
mattdr-at-webrtc.org
2016/07/01 23:57:39
Likewise, no need to increase the surface area by
joachim
2016/07/02 00:12:01
Done.
|
| + |
| // Generates a random id. |
| +// WARNING: will abort() if the RNG fails! Use the version below instead. |
| uint32_t CreateRandomId(); |
| +// Generates a random id. |
| +bool CreateRandomId(uint32_t* id); |
| + |
| // Generates a 64 bit random id. |
| +// WARNING: will abort() if the RNG fails! Use the version below instead. |
| uint64_t CreateRandomId64(); |
| +// Generates a 64 bit random id. |
| +bool CreateRandomId64(uint64_t* id); |
| + |
| // Generates a random id > 0. |
| +// WARNING: will abort() if the RNG fails! Use the version below instead. |
| uint32_t CreateRandomNonZeroId(); |
| +// Generates a random id > 0. |
| +bool CreateRandomNonZeroId(uint32_t* id); |
| + |
| // Generates a random double between 0.0 (inclusive) and 1.0 (exclusive). |
| +// WARNING: will abort() if the RNG fails! Use the version below instead. |
| double CreateRandomDouble(); |
| +// Generates a random double between 0.0 (inclusive) and 1.0 (exclusive). |
| +bool CreateRandomDouble(double* value); |
| + |
| } // namespace rtc |
| #endif // WEBRTC_BASE_HELPERS_H_ |