Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bigyihsuan committed Nov 27, 2022
2 parents 0346030 + 0e2d822 commit d0cf5d0
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,9 @@ class EvalState(Flag):
DEFAULT = auto()
CALLING = auto()

digits = {
"0":0, "1":1,
"2":2, "3":3,
"4":4, "5":5,
"6":6, "7":7,
"8":8, "9":9,
"A":10, "a":10,
"B":11, "b":11,
"C":12, "c":12,
"D":13, "d":13,
"E":14, "e":14,
"F":15, "f":15,
"G":16, "g":16,
"H":17, "h":17,
"I":18, "i":18,
"J":19, "j":19,
"K":20, "k":20,
"L":21, "l":21,
"M":22, "m":22,
"N":23, "n":23,
"O":24, "o":24,
"P":25, "p":25,
"Q":26, "q":26,
"R":27, "r":27,
"S":28, "s":28,
"T":29, "t":29,
"U":30, "u":30,
"V":31, "v":31,
"W":32, "w":32,
"X":33, "x":33,
"Y":34, "y":34,
"Z":35, "z":35 }
digits = {str(k):k for k in range(10)} # numbers
digits.update({chr(k):k - 55 for k in range(65, 91)}) # uppercase alphabet
digits.update({chr(k):k - 87 for k in range(97, 123)}) # lowercase alphabet

# https://stackoverflow.com/a/20170279/8143168
def convert_base(s, base=10):
Expand Down

0 comments on commit d0cf5d0

Please sign in to comment.