def test_urlsafe_base64decode(): l = base64_to_long(N) # convert it to base64 bys = long2intarr(l) data = struct.pack('%sB' % len(bys), *bys) if not len(data): data = '\x00' s0 = base64.b64encode(data) # try to convert it back to long, should throw an exception if the strict # function is used with pytest.raises(ValueError): base64url_to_long(s0) # Not else, should not raise exception l = base64_to_long(s0) assert l
def test_urlsafe_base64decode(): l = base64_to_long(N) # convert it to base64 bys = long2intarr(l) data = struct.pack("%sB" % len(bys), *bys) if not len(data): data = "\x00" s0 = base64.b64encode(data) # try to convert it back to long, should throw an exception if the strict # function is used with pytest.raises(ValueError): base64url_to_long(s0) # Not else, should not raise exception l = base64_to_long(s0) assert l
def test_urlsafe_base64decode(): l = base64_to_long(N) # convert it to base64 bys = long2intarr(l) data = struct.pack('%sB' % len(bys), *bys) if not len(data): data = '\x00' s0 = base64.b64encode(data) # try to convert it back to long, should throw an exception if the strict # function is used try: l = base64url_to_long(s0) except ValueError: pass else: assert False # Not else l = base64_to_long(s0)