Skip to content

Commit

Permalink
Merge pull request #602 from edx/feanil/hash_byte_objects
Browse files Browse the repository at this point in the history
In python 3 unicode strings don't auto coerce to bytes.
  • Loading branch information
feanil authored Sep 20, 2019
2 parents a179233 + 3372c82 commit 1033b5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from __future__ import absolute_import

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '2.0.8'
__version__ = '2.0.9'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
4 changes: 2 additions & 2 deletions edx_proctoring/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ def obscured_user_id(user_id, *extra):
Any extra information can be added to the hash
"""
obs_hash = hmac.new(settings.SECRET_KEY.encode('ascii'), digestmod=hashlib.sha1)
obs_hash.update(six.text_type(user_id))
obs_hash.update(u''.join(six.text_type(ext) for ext in extra))
obs_hash.update(six.text_type(user_id).encode('utf-8'))
obs_hash.update(b''.join(six.text_type(ext).encode('utf-8') for ext in extra))
return obs_hash.hexdigest()


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@edx/edx-proctoring",
"//": "Be sure to update the version number in edx_proctoring/__init__.py",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "2.0.8",
"version": "2.0.9",
"main": "edx_proctoring/static/index.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit 1033b5f

Please sign in to comment.