Restricted-source, take this! a.k.a. You Can Output Anything With Labyrinth Or Hexagony™
Challenge
In a recent restricted-source challenge, I could print any character with only half of the allowed digits with very small character count, by abusing the &quot;digit commands&quot; and modulo-256 output function. Now, it's about time to make a general metagolfer for this kind of challenges.
For the sake of simplicity, we only consider Labyrinth programs of the form &lt;digits&gt;.@, i.e. construct a number, print it modulo 256 as character code, and halt. Also, the sequence of digits acts exactly like a number literal in this case.
Now let's assume we want to solve a restricted-source challenge in the form of:

Given the characters .@ and a subset of 0-9, print a character.

Given a subset of digits D and the target character c, find the shortest number N which will solve the hypothetical challenge above. In other words, N should satisfy the following:

All the digits of N are in D.
The Labyrinth program N.@ prints the character c, i.e. N % 256 == ord(c).

The byte value of c can be anything between 1 and 255 inclusive.


Out of all possible Ns satisfying the above, your program should output one that has the shortest length. If there are multiple possible answers, your program is free to output any of them.

You may take c as a character or an integer (charcode), and digits in D as integers or digit characters. Also, you may assume D is already sorted.
Assume the answer exists. Note that some conditions will lead to &quot;no answer&quot;, e.g. only odd digits are allowed but you need to print an even character, or vice versa. You may assume that such conditions will never be given as input.
Standard code-golf rules apply. The shortest code in bytes wins.
Test cases
The value of c is given as its character code.
D = [1, 2, 3, 4, 5]
c = 1 =&gt; N = 1
c = 57 =&gt; N = 313
c = 254 =&gt; N = 254
c = 100 =&gt; N = 1124 or 4452
c = 107 =&gt; N = 1131, 2155, 2411, or 3435

D = [1, 2, 4, 6, 8]
c = 58 =&gt; N = 826
c = 71 =&gt; N = 1111111
c = 255 =&gt; N = 26111

D = [7]
c = 49 =&gt; N = 777777
JavaScript (ES6), 46 bytes
Saved 6 bytes thanks to @Neil
Expects (D)(c), where D is a string of digits and c is an integer.

D=&gt;c=&gt;eval(`for(;/[^${D}]/.test(c);)c+=256;c`)

Try it online!