Solidity — Random Numbers

Byte Shifting

What is byte shifting?

How do we use byte shifting with RNG?

uint256 >> 8, notice the angle versus >> 16 below

Random Number with Tracking

Random TokenId from Fixed Population

Magical Arrays

[0,0,0,0,0]

First Pass

[0, 0, 0, 0, 0]
[2] = 0
id = 2
if(ids[ids.length-1] == 0)
randomIndex = 2
[0, 0, 4, 0, 0]
[0, 0, 4, 0]

Second Pass

[0, 0, 4, 0]
[0, 0, 3]

Third Pass

[0, 0]

Magic Array

Christmas Teaser

Where to find me

Last Word

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store