const jwt = require('jsonwebtoken');

function toHexString(bytes) {
  return Array.from(bytes, byte =>
    ("00" + (byte & 0xFF).toString(16)).slice(-2)
  ).join('');
}

module.exports = {
  getlinkregByEmail: function (idapp, email, username) {
    try{
      myobj = {
        idapp,
        email,
        username
      };
    return jwt.sign(myobj, process.env.SIGNCODE).toString().substring(0, 180);
    } catch (e) {
      console.error(e.message);
    }
  },



};
