showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.26k stars 1.56k forks source link

feat(helpers): determined results for email address obfuscation #740

Closed alangecker closed 2 years ago

alangecker commented 4 years ago

The same input should always provide the same result. I've got this as a requirement in a project which should processes texts and tries to detect changes in it.

This PR contains my solution for getting determined results based on seeded random number generation.

tivie commented 4 years ago

Hello. Thank you for your contribution. Do all browsers support Math.imul?

alangecker commented 4 years ago

Hello. Thank you for your contribution. Do all browsers support Math.imul?

nope. they don't! ;) I added now the polyfill shown on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul#Polyfill

should now be supported by all browsers specified in the README