# Base64 Numeric Translator

Our standard numbering system is (Base 10). That includes 0 through 9. Binary is (Base 2), only 1’s and 0’s.  And Hexadecimal is (Base 16) (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F). A hexadecimal “F” has a (Base 10) value of 15. (Base 64) has 64 individual characters which translate in value in (Base 10) from between 0 to 63.

####Write a method that will convert a string from (Base 64) to it's (Base 10) integer value.

The (Base 64) characters from least to greatest will be
```
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
```
Where 'A' is equal to 0 and '/' is equal to 63.

Just as in standard (Base 10) when you get to the highest individual integer 9 the next number adds an additional place and starts at the beginning 10; so also (Base 64) when you get to the 63rd digit '/' and the next number adds an additional place and starts at the beginning "BA".

Example:
```
base64_to_base10("/") # => 63
base64_to_base10("BA") # => 64
base64_to_base10("BB") # => 65
base64_to_base10("BC") # => 66
```

Write a method `base64_to_base10` that will take a string (Base 64) number and output it's (Base 10) value as an integer.

Source: codewars | Difficulty: EASY
Tags: Ad-hoc

Starter code: def base64_to_base10(string):
	

Solutions:
DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'

def base64_to_base10(string):
	return sum((DIGITS.index(digit) * 64 ** i for (i, digit) in enumerate(string[::-1])))


base64_to_base10 = lambda strr: int(''.join([('0' * 6 + bin('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.index(c))[2:])[-6:] for c in strr]), 2)


def base64_to_base10(str):
	res = 0
	for c in str:
		res *= 64
		res += 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.find(c)
	return res


base64_to_base10 = lambda s: 0 if len(s) == 0 else 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.index(s[-1]) + 64 * base64_to_base10(s[:-1])


d = {j: i for (i, j) in enumerate('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')}
base64_to_base10 = lambda s: sum((d[j] * 64 ** (len(s) - 1 - i) for (i, j) in enumerate(s)))


abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'

def base64_to_base10(str, order=1):
	return base64_to_base10(str[:-1], order * 64) + abc.index(str[-1]) * order if str else 0


strng = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'

def base64_to_base10(s):
	return sum((strng.index(j) * 64 ** i for (i, j) in enumerate(s[::-1])))


def base64_to_base10(string):
	return sum(['ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.index(letter) * 64 ** power for (power, letter) in enumerate(string[::-1])])


def base64_to_base10(s):
	n = 0
	for c in s:
		n = n * 64 + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.index(c)
	return n


def base64_to_base10(str):
	return sum(('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.index(n) * 64 ** i for (i, n) in enumerate(str[::-1])))