Closed ailisp closed 5 years ago
@ailisp
- This random32 is really a "random seed from current context". Do we want to rename to "random_seed_from_blockchain" and ask user to use it before using AssemblyScript's Math.random
yeah, I'd rename it into random_seed
and implement random32
to use this as a seed on first run, but then just continue generating sequence using some reasonably good PRNG
Math.random
shouldn't be used as it operates on floats (mimicking JS)
Do we want to implement a random without seed needed version api?
Not sure what do you mean by "random without seed needed version api"
Do we want randomBuffer?
Yes
I think random32()
should actually return a generated number based on seed. At least that was the intention.
@bowenwang1996
I think random32() should actually return a generated number based on seed. At least that was the intention.
it's not clear whether you mean that it should return the same number every call or generate new number on each call
It should generate a new number on each call. Will be useful when there are multiple calls to random32
in the same block
@vgrichina
Do we want to implement a random without seed needed version api?
Not sure what do you mean by "random without seed needed version api"
I think your description of random32 is exactly I want here. sorry a duplicate question
@janedegtiareva
I think you already know the requirement before and I just understand after their answers. So would you still like to work on this or me?
Close see #82
I'm still quite unsure about what to fix.
randomBuffer
?