我已经构建了一个生成一个非常独特的模块Message-Id
,但我被要求缩短它,所以我想知道我能把它做多短,所以它仍然是 RFC 2822 有效的并且不会被垃圾邮件过滤器捕获。
我看到 Python生成了一个大约 41 个字符长的字符,这似乎有点太短了。
有什么建议么?
'use strict';
var crypto = require('crypto');
// inspired by http://www.jwz.org/doc/mid.html#3
module.exports = function (hostname) {
var hrtime = process.hrtime();
var microseconds = hrtime[0] * 1000000 + hrtime[1] / 1000;
var token = crypto.randomBytes(64).toString('hex');
var b36 = parseInt(token, 16).toString(36);
var result = '<';
result += microseconds;
result += b36;
result += '@' + hostname;
result += '>';
return result;
};