Compute remainders from right to left when divided by ' b '
let rl = [ ] ; for ( let i = 0 ; i < len + 1 ; i ++ ) rl . push ( 0 ) ; rl [ len - 1 ] = ( str . charCodeAt ( len - 1 ) ) % b ; let power10 = 10 ; for ( let i = len - 2 ; i >= 0 ; i -- ) { rl [ i ] = ( rl [ i + 1 ] + ( str . charCodeAt ( i ) ) * power10 ) % b ; power10 = ( power10 * 10 ) % b ; }