Difference between revisions of "RandomGenerator"
(Created page with "{{newin|0.9.0|090|type=type}} A random number generation object that has a independent random state. == Constructors == {{#ask: Category:Functions [[Constructs::RandomGe...") |
m (Cryptographic usage notice!) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.9.0]]|090|type=type}} | {{newin|[[0.9.0]]|090|type=type}} | ||
− | A random number generation object | + | A random number generation object which has its own random state. |
+ | {{notice|Neither [[love.math.random]], this class, nor Lua [https://www.lua.org/manual/5.1/manual.html#pdf-math.random math.random] generates truly random number, thus it's unsuitable for cryptographic usage!}} | ||
== Constructors == | == Constructors == | ||
− | {{#ask: [[Category:Functions]] [[Constructs::RandomGenerator | + | {{#ask: [[Category:Functions]] [[Constructs::RandomGenerator]] |
| headers=hide | | headers=hide | ||
| default=None. | | default=None. | ||
+ | | format=template | ||
+ | | template=ListingFields | ||
+ | | introtemplate=ListingIntro | ||
+ | | outrotemplate=ListingOutro | ||
| ?Description | | ?Description | ||
+ | | ?PrettySince | ||
+ | | ?PrettyRemoved | ||
+ | | ?PrettyDeprecated | ||
}} | }} | ||
== Functions == | == Functions == | ||
− | {{#ask: [[Category:Functions]] [[parent::RandomGenerator||Object | + | {{#ask: [[Category:Functions]] [[parent::RandomGenerator||Object]] |
| headers=hide | | headers=hide | ||
+ | | format=template | ||
+ | | template=ListingFields | ||
+ | | introtemplate=ListingIntro | ||
+ | | outrotemplate=ListingOutro | ||
| ?Description | | ?Description | ||
+ | | ?PrettySince | ||
+ | | ?PrettyRemoved | ||
+ | | ?PrettyDeprecated | ||
}} | }} | ||
== Supertypes == | == Supertypes == | ||
− | [[Object]] | + | * [[parent::Object]] |
== See Also == | == See Also == | ||
* [[parent::love.math]] | * [[parent::love.math]] | ||
[[Category:Types]] | [[Category:Types]] | ||
− | {{#set:Description=A random number generation object | + | {{#set:Description=A random number generation object which has its own random state.}} |
== Other Languages == | == Other Languages == | ||
{{i18n|RandomGenerator}} | {{i18n|RandomGenerator}} |
Latest revision as of 06:00, 29 July 2021
Available since LÖVE 0.9.0 |
This type is not supported in earlier versions. |
A random number generation object which has its own random state.
Neither love.math.random, this class, nor Lua math.random generates truly random number, thus it's unsuitable for cryptographic usage! |
Constructors
love.math.newRandomGenerator | Creates a new RandomGenerator object. | 0.9.0 |
Functions
Object:release | Immediately destroys the object's Lua reference. | 11.0 | |
Object:type | Gets the type of the object as a string. | ||
Object:typeOf | Checks whether an object is of a certain type. | ||
RandomGenerator:getSeed | Gets the seed of the random number generator. | 0.9.0 | |
RandomGenerator:getState | Gets the current state of the random number generator. | 0.9.1 | |
RandomGenerator:random | Generates a pseudo-random number in a platform independent manner. | 0.9.0 | |
RandomGenerator:randomNormal | Get a normally distributed pseudo random number. | 0.9.0 | |
RandomGenerator:setSeed | Sets the seed of the random number generator. | 0.9.0 | |
RandomGenerator:setState | Sets the current state of the random number generator. | 0.9.1 |
Supertypes
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info