- , UUID. , PRNG. , ( ), - , Base64 . URL- , URL-, , - Java: "http://www.bla.com/jsessionid=". Base64 , URL-.
require 'securerandom'
def produce_token(length=32)
token = SecureRandom.urlsafe_base64(length)
end
2 ^ (- length). Base64, 4/3 *. , OpenSSL PRNG, . OpenSSL , /dev/urandom , , , , Windows, CryptGenRandom . . , produce_token ~ 6 .