.
This commit is contained in:
parent
aa06470cb6
commit
9b287392a4
7 changed files with 636 additions and 294 deletions
|
@ -262,6 +262,19 @@ public:
|
|||
_b[_l++] = (char)c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append secure random bytes
|
||||
*
|
||||
* @param n Number of random bytes to append
|
||||
*/
|
||||
inline void appendRandom(unsigned int n)
|
||||
{
|
||||
if (unlikely((_l + n) > C))
|
||||
throw std::out_of_range("Buffer: append beyond capacity");
|
||||
Utils::getSecureRandom(_b + _l,n);
|
||||
_l += n;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a C-array of bytes
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue