Socialify

Folder ..

Viewing sha256.py
8 lines (6 loc) • 187.0 B

1
2
3
4
5
6
7
8
9
import hashlib

from django import template

register = template.Library()

@register.filter(name='sha256')
def sha256(value):
    return hashlib.sha256(value.encode('utf-8')).hexdigest()