From 6b62849aa40023fd9eba666560984e0edfedc55d Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Thu, 11 Sep 2014 10:26:18 -0300 Subject: generating unique ident for PixelatedMail --- service/pixelated/support/id_gen.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 service/pixelated/support/id_gen.py (limited to 'service/pixelated/support') diff --git a/service/pixelated/support/id_gen.py b/service/pixelated/support/id_gen.py new file mode 100644 index 00000000..6cac7523 --- /dev/null +++ b/service/pixelated/support/id_gen.py @@ -0,0 +1,20 @@ +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see . +import hashlib + + +def gen_pixelated_uid(mbox, leap_message_uid): + return hashlib.md5(mbox + str(leap_message_uid)).hexdigest() -- cgit v1.2.3