Completing functional conversions

This commit is contained in:
= 2019-09-02 04:56:45 -05:00
parent 3cfd9840e8
commit edb16382f3
Signed by: kiichan
GPG key ID: 619DFD67F0976616
29 changed files with 1798 additions and 28 deletions

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from collections import OrderedDict
from os import urandom
import os
import ed25519
from django.utils.crypto import constant_time_compare, salted_hmac
@ -9,6 +10,8 @@ from .utils import Base64, Encoder
class HMAC(object):
"""
Utility class for generating and verifying HMAC signatures.
@ -131,4 +134,4 @@ def generate_randomness(size=32):
str
:meth:`.Base64.encode` encoded random sample
"""
return Base64.encode(urandom(size))
return Base64.encode(bytearray(os.urandom(size)))