param valor param limite returns export const mod11 = ( clearValue , limite ) : number => { const valor = String ( clearValue ) . replace ( /\D/g , '' ) ; let sum = 0 ; let mult = 2 ; for ( let i = valor . length - 1 ; i >= 0 ; i -- ) { sum += mult * + valor [ i ] ; if ( ++ mult > limite ) { mult = 2 ; } } const dv = ( ( sum * 10 ) % 11 ) % 10 ; return dv ; } ;