Task

Take a   Natural Number   in a given base and return the sum of its digits:

   110         sums to   1
   123410   sums to   10
   fe16       sums to   29
   f0e16     sums to   29


  [ temp put 0
    [ over while 
      swap temp share /mod 
      rot + again ]
    nip temp release ]     is digitsum ( n n --> n )               
 
        1 10 digitsum echo sp
     1234 10 digitsum echo sp
   hex FE 16 digitsum echo sp
  hex F0E 16 digitsum echo