I think you can break up a number into its digits with modulo somehow, but I forgot how. You could also do it by taking the number, dividing it by thousand, and rounding down. Then you have the thousands digit. Substract the thousands from the number, then divide by 100 and round down. You get the 100s digit. And so on.
Example:
number to break up into digits = 1763
1763/1000=1.763, rounded down = 1 //thousands digit
1763-1000=763
763/100=7.63, rounded down = 7 //hundreds digit
763-700=63
63/10=6.3, rounded down = 6 //tens digit
63-60=3 //ones digit
There probably is a more easy way, but I cant think of it now.
Of course you dont need all this. Just do some kind of calculation with the number, like multiplying with a random prime number out of a selection of ten prime numbers and assigning a digit to every prime number. 2 = 4, 3 = 6, 5 = 0, 7 = and so on. Put that digit on a fixed place in the code. Like for example the fifth digit of the code designates what it was multiplied by. To save it in the middle of the code you would have to break the code up into single digits, though. If you want to put it to the end of the code its very simple, just multiply the code by ten and add the digit, so if you don't want to do the work of breaking the code up do it that way. If you want to put it somewhere to the middle of the code youd have to make sure the code has at least the number of digits you want to put your key digit to, though.
Example:
The number you want to save is 79
The prime number that was chosen is 3
79*3 = 237
key digit for 3 = 6
Lets assume you want to put the key digit to the third digit in your code.
After doing the above procedure you get the digits 2, 3 and 7.
Now you put them back together, but with 6 as the third digit.
You get the code 2367
The problem is that this way your code doesnt have a fixed length, and all codes are valid, so its not a very good encryption, at least not if more wood = better. People would eventually notice that more wood means longer code and just add a few digits to the end of the code. Another problem is that its hard to save multiple numbers if the code doesnt have a fixed number of digits. You would need to use some kind of seperator, which again decreases the safety of the code.
With setting letters as equivalents to digits not every code is valid, so it is harder to cheat. It's more work, though.