ASCII art uncompression from a base-n number This is inspired by an 05AB1E answer by Magic Octupus Urn.

Given two arguments, a positive integer and a string/list of characters:


Translate the number to base-n, where n is the length of the string.
For each character, replace every appearance of the index of that character in the base-n number with that character.
Print or return the new string.


Examples:

Input:
2740, ["|","_"]
2740 -&gt; 101010110100 in base 2
     -&gt; Replace 0s with "|" and 1s with "_"
Output: _|_|_|__|_||

Input:
698911, ["c","h","a","o"]
698911 -&gt;  2222220133 in base 4
       -&gt;  Replace 0s with "c", 1s with "h", 2s with "a", and 3s with "o"
Output -&gt; "aaaaaachoo"

Input:
1928149325670647244912100789213626616560861130859431492905908574660758972167966, [" ","\n","|","_","-"]
Output:
    __   __    
   |  |_|  |   
___|       |___
-   -   -   -  
 - - - - - - - 
- - - - - - - -
_______________

Input: 3446503265645381015412, [':', '\n', '.', '_', '=', ' ', ')', '(', ',']
Output:
_===_
(.,.)
( : )
( : )


Rules:


IO is flexible.


You can take the number in any base, as long as it is consistent between inputs
The list of characters has to be 0-indexed though, where 0 is the first character and n-1 is the last

Possible characters can be any printable ASCII, along with whitespace such as tabs and newlines
The given list of characters will have a length in the range 2-10 inclusive. That is, the smallest base is binary and the largest is decimal (no pesky letters here)
Standard loopholes are forbidden
Feel free to answer even if your language can't handle the larger test cases.


As this is code-golf, the shortest code for each language wins. (I know all you golfing languages have one byte built-ins ready to go ;)
05AB1E, 7 6 bytes
gв¹sèJ

Since it was inspired by an 05AB1E answer, an answer given in 05AB1E seems fitting. :)
-1 byte thanks to @Emigna by removing the foreach and doing this implicitly.
Try it online or verify all test cases.
Explanation:

g         # `l`: Take the length of the first (string) input
 в        # And then take the second input in base `l`
          # For each digit `y` of this base-converted number:
  ¹sè     #  Push the `y`'th character of the first input
     J    # Join everything together (and output implicitly)