Completing functional conversions
This commit is contained in:
parent
3cfd9840e8
commit
edb16382f3
29 changed files with 1798 additions and 28 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue