#GNU dc, 14 bytes
Borrowing @Dennis's clever base 9 trick@Dennis's clever base 9 trick:
9i[?A%nd]dxxxx Input integers read from STDIN, one per line.
###Explanation:
9i # Set input radix to 9 [ ] # push a macro, defined thus: ? # read number from STDIN and push A # push literal 10 % # calculate number mod 10 n # print, with no newline d # duplicate macro d # duplicate macro xxxx # execute the macro 4 times ###Output:
$ for i in 57 23 99 45; do echo $i; done | dc ./combolock.dc 2101$ $ for i in 25 78 63 15; do echo $i; done | dc ./combolock.dc 3174$ $ ###Previous Answer, 18 bytes:
Because I thought I could get closer to the "golfing" languages with this (but didn't):
[A?A~--A%n]dddxxxx