token generator code