Re: Simple encoding function

2005-03-31 Thread John W. Krahn
Ing. Branislav Gerzo wrote: John W. Krahn [JWK], on Wednesday, March 30, 2005 at 12:56 (-0800) thoughtfully wrote the following: JWK You could use the Math::BaseCalc module: JWK http://search.cpan.org/~kwilliams/Math-BaseCalc-1.011/ thanks, it is nice module, really easy to use. And also thanks to

Re: Simple encoding function

2005-03-31 Thread Ing. Branislav Gerzo
John W. Krahn [JWK], on Thursday, March 31, 2005 at 01:56 (-0800) has on mind: JWK Two different digits are converted to 0? JWK The same digit is converted to two different values? qood questions; ok, I changed @chars to: my @chars = ( 0 .. 9 ); now here is list of results: 0 = 0 9 = 9 10

Re: Simple encoding function

2005-03-31 Thread John W. Krahn
Ing. Branislav Gerzo wrote: John W. Krahn [JWK], on Thursday, March 31, 2005 at 01:56 (-0800) has on mind: JWK Two different digits are converted to 0? JWK The same digit is converted to two different values? qood questions; ok, I changed @chars to: my @chars = ( 0 .. 9 ); now here is list of

Simple encoding function

2005-03-30 Thread Ing. Branislav Gerzo
Hi pals, I'd like to code my own encode function, I have @list of allowed characters, my input is number, and I'd like to 'convert' number to characters. Here is script I coded, but I'm sure it could be really better. This script should work, but there are too much conditions and isn't so clear

Re: Simple encoding function

2005-03-30 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Hi pals, Hello, I'd like to code my own encode function, I have @list of allowed characters, my input is number, and I'd like to 'convert' number to characters. Here is script I coded, but I'm sure it could be really better. This script should work, but there are too

Re: Simple encoding function

2005-03-30 Thread John W. Krahn
John W. Krahn wrote: Or if you really want to do it yourself: $ perl -le' my $num = 123456789; { my @digits = ( a .. z, A .. Z, 0 .. 9, -, _ ); sub fn { my $in = shift; my $res = ; while ( $in ) { substr $res, 0, 0, $digits[ $in % @digits ];

Re: Simple encoding function

2005-03-30 Thread Ing. Branislav Gerzo
John W. Krahn [JWK], on Wednesday, March 30, 2005 at 12:56 (-0800) thoughtfully wrote the following: JWK You could use the Math::BaseCalc module: JWK http://search.cpan.org/~kwilliams/Math-BaseCalc-1.011/ thanks, it is nice module, really easy to use. And also thanks to your program, but I have