2014-10-30 09:17:47 -07:00
|
|
|
from django.conf import settings
|
2014-08-18 09:01:33 -07:00
|
|
|
from django import template
|
|
|
|
|
2014-10-20 08:50:04 -07:00
|
|
|
import hmac, hashlib, os
|
2014-08-18 09:01:33 -07:00
|
|
|
|
|
|
|
register = template.Library()
|
|
|
|
|
|
|
|
@register.filter
|
|
|
|
def intercom_sha_256(user_id):
|
2014-10-30 09:17:47 -07:00
|
|
|
return hmac.new(os.environ.get('INTERCOM_SECRET_KEY', settings.INTERCOM_SECRET_KEY), str(user_id), digestmod=hashlib.sha256).hexdigest()
|