# Path: esteid/constants.py
# HASH_ALGORITHMS = {
#     HASH_SHA256,
#     HASH_SHA384,
#     HASH_SHA512,
# }


import hashlib
import os
import re
from collections import OrderedDict
from datetime import datetime
from django.utils import timezone
from esteid.constants import HASH_ALGORITHMS




def secure_random(n):
    return os.urandom(n)


def generate_hash(algorithm, data):
    """Hash the data with the supplied algorithm

    https://github.com/SK-EID/smart-id-documentation#33-hash-algorithms
    https://github.com/SK-EID/MID#231-supported-hashing-algorithms
    """

# Path: esteid/constants.py
# HASH_ALGORITHMS = {
#     HASH_SHA256,
#     HASH_SHA384,
#     HASH_SHA512,
# }


# Path: esteid/util.py
import hashlib
import os
import re
from collections import OrderedDict
from datetime import datetime
from django.utils import timezone
from esteid.constants import HASH_ALGORITHMS





def secure_random(n):
    return os.urandom(n)


def generate_hash(algorithm, data):
    """Hash the data with the supplied algorithm

    https://github.com/SK-EID/smart-id-documentation#33-hash-algorithms
    https://github.com/SK-EID/MID#231-supported-hashing-algorithms
    """

    if algorithm.upper() not in HASH_ALGORITHMS: