2 releases

0.1.2 Mar 30, 2023
0.1.1 Mar 29, 2023
0.1.0 Mar 29, 2023

#1958 in Algorithms

38 downloads per month

MIT license

20KB
143 lines


What

This is not a pseudorandom number generator.

It is #![no_std] by nature with only core as dependency, and alloc if you use the informational feature distribution.

The generator can be seeded with the raw value of a pointer for semi-randomness.

You should take a look at the generator's distributions to see if this works for you.

Distributions

Seed Digits (Base 10) Bytes
0x00000000
                              ███
▄▄▄                       ▄▄▄ ███
███                       ███ ███
███                       ███ ███
███                       ███ ███
███ ███               ███ ███ ███
███ ███               ███ ███ ███
███ ███               ███ ███ ███
███ ███ ██         ██ ███ ███ ███
███ ███ ██ ▄▄ ▄ ▄▄ ██ ███ ███ ███
0   1   2  3  4 5  6  7   8   9
210 120 45 10 2 10 45 120 210 252
            
                 ███
             ▄▄▄ ███ ▄▄▄
             ███ ███ ███
             ███ ███ ███
             ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
      ██ ███ ███ ███ ███ ███ ██
▄▄ ▄▄ ██ ███ ███ ███ ███ ███ ██ ▄▄ ▄▄
54 55 56 57  58  59  60  61  62 63 64
1  10 45 120 210 252 210 120 45 10 1
            
0x0000FFFF
                          ███
                      ▄▄▄ ███ ▄▄▄
                      ███ ███ ███
                      ███ ███ ███
                      ███ ███ ███
███               ███ ███ ███ ███
███               ███ ███ ███ ███
███               ███ ███ ███ ███
███ ██         ██ ███ ███ ███ ███
███ ██ ▄▄ ▄ ▄▄ ██ ███ ███ ███ ███
0   1  2  3 4  5  6   7   8   9
120 45 11 1 10 45 120 210 252 210
            
                 ███
             ▄▄▄ ███ ▄▄▄
             ███ ███ ███
             ███ ███ ███
             ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
      ██ ███ ███ ███ ███ ███ ██
▄▄ ▄▄ ██ ███ ███ ███ ███ ███ ██ ▄▄ ▄▄
48 54 55 56  57  58  59  60  61 62 63
1  10 45 120 210 252 210 120 45 10 1
            
0xFFFF0000
                      ███
                  ▄▄▄ ███ ▄▄▄
                  ███ ███ ███
                  ███ ███ ███
                  ███ ███ ███
              ███ ███ ███ ███ ███
              ███ ███ ███ ███ ███
              ███ ███ ███ ███ ███
██         ██ ███ ███ ███ ███ ███
██ ▄▄ ▄ ▄▄ ██ ███ ███ ███ ███ ███
0  1  2 3  4  5   6   7   8   9
45 10 2 10 45 120 210 252 210 120
            
                 ███
             ▄▄▄ ███ ▄▄▄
             ███ ███ ███
             ███ ███ ███
             ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
      ██ ███ ███ ███ ███ ███ ██
▄▄ ▄▄ ██ ███ ███ ███ ███ ███ ██ ▄▄ ▄▄
38 39 40 41  42  43  44  45  46 47 48
1  10 45 120 210 252 210 120 45 10 1
            
0xFFFFFFFF
                              ███
▄▄▄                       ▄▄▄ ███
███                       ███ ███
███                       ███ ███
███                       ███ ███
███ ███               ███ ███ ███
███ ███               ███ ███ ███
███ ███               ███ ███ ███
███ ███ ██         ██ ███ ███ ███
███ ███ ██ ▄▄ ▄ ▄▄ ██ ███ ███ ███
0   1   2  3  4 5  6  7   8   9
211 120 45 10 1 10 45 120 210 252
            
                 ███
             ▄▄▄ ███ ▄▄▄
             ███ ███ ███
             ███ ███ ███
             ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
         ███ ███ ███ ███ ███
      ██ ███ ███ ███ ███ ███ ██
▄▄ ▄▄ ██ ███ ███ ███ ███ ███ ██ ▄▄ ▄▄
32 54 55 56  57  58  59  60  61 62 63
1  10 45 120 210 252 210 120 45 10 1
            
Random Pointer
          ███
          ███ ███
      ▄▄▄ ███ ███
      ███ ███ ███
      ███ ███ ███ ▄▄▄
      ███ ███ ███ ███
   ▄▄ ███ ███ ███ ███
   ██ ███ ███ ███ ███
   ██ ███ ███ ███ ███ ██
██ ██ ███ ███ ███ ███ ██ ▄▄ ▄ ▄
0  1  2   3   4   5   6  7  8 9
20 85 196 273 243 141 52 11 1 2
            
             ▄▄▄ ███
             ███ ███
             ███ ███
             ███ ███ ███
         ▄▄▄ ███ ███ ███
         ███ ███ ███ ███
         ███ ███ ███ ███
         ███ ███ ███ ███ ██
      ██ ███ ███ ███ ███ ██
▄▄ ▄▄ ██ ███ ███ ███ ███ ██ ██ ▄▄
27 28 29 30  31  32  33  34 35 36
1  11 53 145 248 273 191 81 19 2
            

No runtime deps

Features