- alias -l involution {
- var %i = 1 , %i0 = 1 , %i1 = 1 , %i2 = 1 , %i3 = 1
- hadd -m crypte max 0
- while ($gettok($1-,%i,32)) { if ( $len($ifmatch) > $hget(crypte,max) ) { hadd -m crypte max $ifmatch } | inc %i }
- while ($gettok($1-,%i0,32)) { hadd -m crypte m- $+ %i0 $ifmatch $+ $str($chr(1),$calc($hget(crypte,max) - $len($ifmatch))) | inc %i0 }
- while ( %i1 <= $hget(crypte,max) ) {
- var %i2 = 1
- while ( %i2 <= $gettok($1-,0,32) ) { hadd -m crypte t- $+ %i1 $hget(crypte,t- $+ %i1) $+ $mid($hget(crypte,m- $+ %i2),%i1,1) | inc %i2 }
- inc %i1
- }
- while ( $hget(crypte,t- $+ %i3) ) { hadd -m crypte return $hget(crypte,return) $ifmatch | inc %i3 }
- }
-
- alias crypte_invo {
- if ( $hget(crypte).size > 0 ) { hfree crypte }
- hmake -m crypte 100
- $involution($1-)
- return $remove($hget(crypte,return),$chr(1))
- }
alias -l involution {
var %i = 1 , %i0 = 1 , %i1 = 1 , %i2 = 1 , %i3 = 1
hadd -m crypte max 0
while ($gettok($1-,%i,32)) { if ( $len($ifmatch) > $hget(crypte,max) ) { hadd -m crypte max $ifmatch } | inc %i }
while ($gettok($1-,%i0,32)) { hadd -m crypte m- $+ %i0 $ifmatch $+ $str($chr(1),$calc($hget(crypte,max) - $len($ifmatch))) | inc %i0 }
while ( %i1 <= $hget(crypte,max) ) {
var %i2 = 1
while ( %i2 <= $gettok($1-,0,32) ) { hadd -m crypte t- $+ %i1 $hget(crypte,t- $+ %i1) $+ $mid($hget(crypte,m- $+ %i2),%i1,1) | inc %i2 }
inc %i1
}
while ( $hget(crypte,t- $+ %i3) ) { hadd -m crypte return $hget(crypte,return) $ifmatch | inc %i3 }
}
alias crypte_invo {
if ( $hget(crypte).size > 0 ) { hfree crypte }
hmake -m crypte 100
$involution($1-)
return $remove($hget(crypte,return),$chr(1))
}