[SECURITY] Better token generator
Merge pull request #1167 from TheSerapher/issue-1158

[SECURITY] Better token generator