register code. core component: rng.js. session component: createToken.