How to use the shortid.seed function in shortid

To help you get started, we’ve selected a few shortid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CleverStack / node-seed / modules / clever-email / services / EmailService.js View on Github external
email: {},
                usersCC: [],
                usersBCC: [],
                attachments: [],
                sender: {}
            };

            var hasTemplate = (/false|true/.test( data.hasTemplate )) ? data.hasTemplate : true
              , fullName = data.userFirstName || data.userLastName
                    ? [ data.userFirstName, data.userLastName ].join( ' ' )
                    : config['clever-email'].default.fromName;

            //Email Object
            o.email.subject = data.subject || null;
            o.email.body = data.body || null;
            o.email.token = data.userId + data.to.id + shortid.seed( 10000 ).generate();
            o.email.UserId = data.userId;
            o.email.AccountId = data.accId;
            o.email.EmailTemplateId = data.EmailTemplateId || null;
            o.email.sentAttemps = 0;
            o.email.isDelivered = false;
            o.email.isOpened = false;
            o.email.id = null;

            var emailURL = this.formatReplyAddress( o.email.token );

            //Dump email dependency data
            var dataDump = {
                companyLogo: data.accLogo,
                companyName: data.accName,
                fromName: fullName,
                fromMail: emailURL,
github jedrichards / couchdb-tools / index.js View on Github external
exports.shortid = function (seed) {
    if ( typeof seed != 'undefined' ) {
        shortid.seed(seed);
    }
    return shortid.generate()
}

shortid

Amazingly short non-sequential url-friendly unique id generator.

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis