mirror of
https://github.com/panda3d/panda3d.git
synced 2026-02-05 14:49:07 -06:00
A workaround for the bug described in #684 was made in e080d33e31 but this fix is significantly cleaner.
Unit test was added.
15 lines
415 B
Python
15 lines
415 B
Python
from panda3d import core
|
|
|
|
|
|
def test_encrypt_string():
|
|
# Test encrypt and then decrypt cycle
|
|
enc = core.encrypt_string('abcdefg', '12345')
|
|
assert len(enc) > 0
|
|
|
|
dec = core.decrypt_string(enc, '12345')
|
|
assert dec == 'abcdefg'
|
|
|
|
# Test pre-encrypted string
|
|
enc = b'[\x00\x10\x00d\x00\xb5\x7f\xc44Y\xb7\xd9\x15\xe3\xbd\xcf\xb3yK\xfb\xf6'
|
|
assert 'test' == core.decrypt_string(enc, '98765')
|