New token generator algorithm