This is a simple math function. For example, in binary you have two possible characters for 3 locations is (2 ^ 3) = 8 000, 001, 010, 100, 011, 110, 101, 111

In your case you have 36 possible characters for 3 positions (36 ^ 2) = 46656

In your case you have 36 possible characters for 3 positions (36 ^ 2) = 46656