miniBill/elm-salsa20/1.0.0

Random.Salsa20

Random generator API for Salsa20. This should be used with NoRedInk/elm-random-general to have a nice API for generating random, cryptographically secure, numbers.

Warning: if you use this module directly (which you shouldn't, use elm-random-general), it is your responsibility to make sure you don't call peel more than once on the same State

type State

The internal state of the generator. Contains the key, nonce and a counter.

init : Key -> Nonce -> State

Initialize the generator. This stores the key and nonce inside the state, and sets the counter to 0.

Increments the counter.

peel : State -> Int

Gets an Int out of the current state. The result will be an unsigned 32 bit integer.