How to use the ts-md5/dist/md5.Md5.hashAsciiStr function in ts-md5

To help you get started, we’ve selected a few ts-md5 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 moodlehq / moodlemobile2 / src / addon / messages / pages / discussion / discussion.ts View on Github external
protected addMessage(message: any, keep: boolean = true): void {
        /* Create a hash to identify the message. The text of online messages isn't reliable because it can have random data
           like VideoJS ID. Try to use id and fallback to text for offline messages. */
        message.hash = Md5.hashAsciiStr(String(message.id || message.text || '')) + '#' + message.timecreated + '#' +
                message.useridfrom;

        if (typeof this.keepMessageMap[message.hash] === 'undefined') {
            // Message not added to the list. Add it now.
            this.messages.push(message);
        }
        // Message needs to be kept in the list.
        this.keepMessageMap[message.hash] = keep;
    }

ts-md5

TypeScript MD5 implementation

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis