2.0.3 • Published 2 years ago

tkgenerator v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Token Generator

  • easily create encrypted tokens

  • pass information through the token like date and time

  • compatible with typescript projects

    import TokenSystem from 'tkgenerator';

    const user_data = {
        name: 'Lucas',
        email: 'email@test.com',
        password: '1234567890',
    }

    const token = TokenSystem.TokenGenerator(user_data)

    console.log(token) // 9JDM4UjMzojI5RXa05WZklmIsIiMyAjMvcDMvMTMiojIlRXYkJCLiEDN6IDM6UTMiojIl1Wa0JCLiATO4cjN1QzMyEjI6ICZy92dzNXYw9FdhVGclJnIsICM5gzN2UDNzITMiojIkJ3b3N3chBnIsISbvNmLzF2Y1xGQzF2Y1xmI6ICbpFWblJCLiMXYjVHTiojIl1WYuJye

    const decoded = TokenSystem.TokenDecoder(token)

    console.log(decoded)
    /*
    {
        name: 'Lucas',
        email: 'email@test.com',
        password: '1234567890',
        time: '15:02:41',           // Time of generation
        date: '13/07/2022',         // Date of generation
        identity: 2601103957020366  // random number
    }
    */

   console.log(decoded.identity) // 325802
   console.log(decoded.name) // Lucas