5 kyu

Base64 Numeric Translator

110 of 1,220danielpclark

Description:

Our standard numbering system is base-10, that uses digits 0 through 9. Binary is base-2, using only 1s and 0s. And hexadecimal is base-16, using digits 0 to 9 and A to F. A hexadecimal F has a base-10 value of 15.

Base-64 has 64 individual characters ("digits") which translate to the base-10 values of 0 to 63. These are (in ascending order):

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

(so A is equal to 0 and / is equal to 63)

Task

Complete the method that will take a base-64 number (as a string) and output its base-10 value as an integer.

Examples

"/"   -->  63
"BA"  -->  64
"BB"  -->  65
"BC"  -->  66
"WIN" -->  90637
Puzzles

More By Author:

Check out these other kata created by danielpclark

Stats:

CreatedOct 30, 2015
PublishedOct 30, 2015
Warriors Trained2099
Total Skips225
Total Code Submissions3030
Total Times Completed1220
Ruby Completions110
Python Completions590
JavaScript Completions313
CoffeeScript Completions12
Haskell Completions109
C Completions162
Total Stars38
% of votes with a positive feedback rating90% of 202
Total "Very Satisfied" Votes167
Total "Somewhat Satisfied" Votes31
Total "Not Satisfied" Votes4
Ad
Contributors
  • danielpclark Avatar
  • jhoffner Avatar
  • bkaes Avatar
  • anter69 Avatar
  • solitude Avatar
  • trashy_incel Avatar
  • Formula-9 Avatar
  • meni181818 Avatar
Ad