You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avutil/random_seed: add av_random_bytes()
Uses the existing code for av_get_random_seed() to return a buffer with cryptographically secure random data, or an error if none could be generated. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -36,6 +36,19 @@
|
||||
*/
|
||||
uint32_t av_get_random_seed(void);
|
||||
|
||||
/**
|
||||
* Generate cryptographically secure random data, i.e. suitable for use as
|
||||
* encryption keys and similar.
|
||||
*
|
||||
* @param buf buffer into which the random data will be written
|
||||
* @param len size of buf in bytes
|
||||
*
|
||||
* @retval 0 success, len bytes of random data was written
|
||||
* into buf
|
||||
* @retval "a negative AVERROR code" random data could not be generated
|
||||
*/
|
||||
int av_random_bytes(uint8_t *buf, size_t len);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user