05AB1E, 17 17 16 bytes
b8jJð0:IgbgôC0K<è₁+b€¦JIgbgôC0K<è
Port of @emanresuA's Vyxal answer, so make sure to upvote him/her as well!
-1 byte thanks to @CommandMaster
Outputs as a list of characters.
Try it onlineTry it online or verify all test casesverify all test cases.
Explanation:
b₁+ # Add #256 Convertto theeach integersinteger in the first (implicit) input-list to
b # Convert #them to binary-strings
8j €¦ # PadRemove the leading spaces"1" tofrom each to make their lengths 8
J J # Join the list of strings together
ð0: # Replace all spaces with 0s
I # Push the second input-string
g # Pop and push its length
b # Convert it to binary
g # Pop and push its length
ô # Split the earlier string into parts of that size
C # Convert each inner string from binary to a base-10 integer
0K # Remove all 0s
< # Decrease each by 1 the 1-based indices 0-based
è # Use it to index into the second (implicit) input-string
# (after which the resulting list is output implicitly)