Orc/discount — pull request #112 by AGWA (2014-09-23 18:20:09+00:00)
Title: Mangle email addresses deterministically

Hi,

I'm working on the [Reproducible Builds][1] project in Debian, which is trying to make it possible to rebuild every package in Debian reproducibly. Once complete, reproducible builds will let users independently verify that a binary package corresponds to its purported source and hasn't been surreptitiously modified.

Some of our packages use discount to generate their documentation, and we've noticed that discount currently [mangles email addresses in a random manner][2]. This causes different builds of these packages to be different. We assume that the current behavior of randomly choosing between hex and decimal encoding is intended to defeat email scrapers that understand one encoding but not the other. Could discount instead alternate every other character between hex and decimal? This would accomplish the same effect but in a deterministic manner.

The following patch changes the `mangle` function accordingly. Could it be applied to discount?

Thanks!
Andrew

[1]: https://wiki.debian.org/ReproducibleBuilds
[2]: https://github.com/Orc/discount/blob/4de75a3026ae47bde4b53fce71d486a42cce82aa/generate.c#L788