llHMAC implementation (without importing hmac)

This commit is contained in:
Sei Lisa 2023-02-03 21:48:33 +01:00
parent 1bd9551c2f
commit 500a8bb751
5 changed files with 71 additions and 3 deletions

View file

@ -23,14 +23,15 @@ codecs.register(lambda x: codecs.lookup('utf8') if x == 'cp65001' else None)
import sys
python2Narrow = False
if sys.version_info.major >= 3:
unicode = str
unichr = chr
xrange = range
python3 = True
python2 = False
python2Narrow = False
uniwrap = unicode
bytewrap = bytes
def str2u(s, enc=None):
"""Convert a native Python3 str to Unicode. This is a NOP."""
@ -60,8 +61,8 @@ else:
xrange = xrange
python2 = True
python3 = False
python2Narrow = False
uniwrap = unicode
bytewrap = bytearray
def str2u(s, enc=None):
"""Convert a native Python2 str to Unicode."""