# reverse of modulo (inverse?)

am 14.06.2011 15:39:00 von Deane.RothenmaierThis is a multipart message in MIME format.

--===============1664711889==

Content-Type: multipart/alternative;

boundary="=_alternative 004AFBFC862578AF_="

This is a multipart message in MIME format.

--=_alternative 004AFBFC862578AF_=

Content-Type: text/plain; charset="US-ASCII"

Greetings.

I'm not having much luck finding this, and it's been a long time since

college math, so I thought I'd throw it at you folks and cross my

fingers...

I'm looking for an algorithm that reverses the modulo function. That is,

if x = y % 256, given x, what is y?

Broader picture is, I'm trying to back-figure a site number from an IP

address. E.g., given number x = 12345, the IP's middle octets ( x/256 and

x%256 respectively) come out to 48 and 57 . Is there an algorithm I can

put the numbers 48 and 57 into and have 12345 come out?

I looked in cpan and got lost, I've tried a few math sites, they all talk

about inverse of modulo, but I'm not sure that's what I'm asking for.

Here's hoping the collective wisdom will rescue me.

Thanks in advance!

Deane Rothenmaier

Programmer/Analyst -- IT-StdCfg

Walgreens Corp.

2 Overlook Point #N5102D

MS 6515

Lincolnshire, IL 60069

224-542-5150

If you have to write your ethical rules down, it's already too late. --

Tom Clancy

--=_alternative 004AFBFC862578AF_=

Content-Type: text/html; charset="US-ASCII"

Greetings.

I'm not having much luck finding this,

and it's been a long time since college math, so I thought I'd throw it

at you folks and cross my fingers...

I'm looking for an algorithm that reverses

the modulo function. That is, if x = y % 256, given x, what is y?

Broader picture is, I'm trying to back-figure

a site number from an IP address. E.g., given number x = 12345, the IP's

middle octets ( x/256 and x%256 respectively) come out to 48 and 57 . Is

there an algorithm I can put the numbers 48 and 57 into and have 12345

come out?

I looked in cpan and got lost, I've

tried a few math sites, they all talk about inverse of modulo, but I'm

not sure that's what I'm asking for. Here's hoping the collective wisdom

will rescue me.

Thanks in advance!

Deane Rothenmaier

Programmer/Analyst -- IT-StdCfg

Walgreens Corp.

2 Overlook Point #N5102D

MS 6515

Lincolnshire, IL 60069

224-542-5150

If you have to write your ethical rules down, it's already too late. --

Tom Clancy

--=_alternative 004AFBFC862578AF_=--

--===============1664711889==

Content-Type: text/plain; charset="us-ascii"

MIME-Version: 1.0

Content-Transfer-Encoding: 7bit

Content-Disposition: inline

_______________________________________________

ActivePerl mailing list

ActivePerl@listserv.ActiveState.com

To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

--===============1664711889==--