-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a few new modules (base64, canceler) Updated several modules. Improved speed of crypt module. All previously encrypted files are still completely compatible with the program
- Loading branch information
1 parent
46b696f
commit 06ca209
Showing
10 changed files
with
167 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import base64; | ||
import string; | ||
|
||
DEFAULT_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | ||
|
||
def b64decode(s, altchars = {}): | ||
if isinstance(altchars, dict): | ||
altchars = (''.join(altchars.keys()), ''.join(altchars.values())); | ||
s = s.translate(string.maketrans(*altchars[::-1])); | ||
return base64.b64decode(s); | ||
|
||
def b64encode(s, altchars = None): | ||
if isinstance(altchars, dict): | ||
altchars = (''.join(altchars.keys()), ''.join(altchars.values())); | ||
s = base64.b64encode(s); | ||
return s.translate(string.maketrans(*altchars)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class Canceler(object): | ||
def __init__(self, fake = False): | ||
self.__can = False; | ||
self.__fake = fake; | ||
|
||
def cancel(self): | ||
if not self.__fake: | ||
self.__can = True; | ||
|
||
def get(self): | ||
return self.__can; | ||
|
||
def reset(self): | ||
self.__can = False; | ||
|
||
FAKE = Canceler(True); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
setuptools.setup( | ||
name = "creatorUtils", | ||
version = "0.2.0", | ||
version = "0.2.1", | ||
author = "The Elemental of Creation", | ||
author_email = "[email protected]", | ||
description = "creatorUtils main package", | ||
|