-
-
Notifications
You must be signed in to change notification settings - Fork 3
libsodium.RandomBytes
Andrew Lambert edited this page Nov 26, 2022
·
7 revisions
libsodium.RandomBytes
Protected Function RandomBytes(Count As UInt32, Optional Seed As MemoryBlock) As MemoryBlock
Name | Type | Comment |
---|---|---|
Count | UInt32 | The number of unpredictable bytes to generate. |
Seed | MemoryBlock | Optional. The data to seed the PRNG with. (See remarks) |
A MemoryBlock containing exactly Count
unpredictable bytes, or Nil
on error.
Generates a MemoryBlock filled with the requested number of unpredictable bytes. Data returned from this function is suitable for use as a random key, nonce, or salt.
If the optional Seed
value is specified then this operation is deterministic. The Seed
must be exactly randombytes_SEEDBYTES
(32) bytes long.
- RandomUInt32
- Generating random data in the libsodium documentation.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.