You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Martin A. Langhoff" <ma...@scim.net> on 2000/04/06 21:32:38 UTC

[OT][General Programming] Key Generator sub

hi list!

    I'm guilty of being a self taught programmer, and so, from time to
time, I find myself asking silly questions. Hope you don't mind too
much.

    [if you do, flame me privately, please ... lets keep my shame
between the two of us]

    ok, what I'm looking for is a poor man's crypt(). And a simple one,
because whatever logic I use, I must reproduce in a limited proprietary
language (Macromedia Director's "Lingo"). Lingo won't allow me to do bit
math, 'xor' nor any sophisticated scheme. Plain math stuff and string
manipulation.

    On the other hand, neither the target audience nor the intended use
is high end. It's just a quick lock to control the spreading of an app
to no more than 100 users.
    I won't be locking nuclear warheads with it :)

    Is there any 'teaching book' example? Maybe a listmember with proper
education can tell me?


martin
--                                                         --
To understand recursion, one must first understand recursion.
--                                                         --
    - Martin Langhoff @ S C I M  Multimedia Technology -
      - http://www.scim.net      | God is real until  -
      - mailto:mlangho@scim.net  | declared integer   -


Re: [OT][General Programming] Key Generator sub

Posted by "Martin A. Langhoff" <ma...@scim.net>.
I think I'll follow this path. You mean turn the string into a number using
the chr value?

Marshall Dudley wrote:

> The easiest way to do a crypt with plain vanilla 4 funtion math is to turn
> the string into a number, then divide the number by a large prime number.
> Then take the decimal part of the answer, and truncate to the desired
> length.
>
> Marshall

--                                                         --
To understand recursion, one must first understand recursion.
--                                                         --
    - Martin Langhoff @ S C I M  Multimedia Technology -
      - http://www.scim.net      | God is real until  -
      - mailto:mlangho@scim.net  | declared integer   -




Re: [OT][General Programming] Key Generator sub

Posted by Marshall Dudley <md...@execonn.com>.
The easiest way to do a crypt with plain vanilla 4 funtion math is to turn
the string into a number, then divide the number by a large prime number.
Then take the decimal part of the answer, and truncate to the desired
length.

Marshall

"Martin A. Langhoff" wrote:

> hi list!
>
>     I'm guilty of being a self taught programmer, and so, from time to
> time, I find myself asking silly questions. Hope you don't mind too
> much.
>
>     [if you do, flame me privately, please ... lets keep my shame
> between the two of us]
>
>     ok, what I'm looking for is a poor man's crypt(). And a simple one,
> because whatever logic I use, I must reproduce in a limited proprietary
> language (Macromedia Director's "Lingo"). Lingo won't allow me to do bit
> math, 'xor' nor any sophisticated scheme. Plain math stuff and string
> manipulation.
>
>     On the other hand, neither the target audience nor the intended use
> is high end. It's just a quick lock to control the spreading of an app
> to no more than 100 users.
>     I won't be locking nuclear warheads with it :)
>
>     Is there any 'teaching book' example? Maybe a listmember with proper
> education can tell me?
>
> martin
> --                                                         --
> To understand recursion, one must first understand recursion.
> --                                                         --
>     - Martin Langhoff @ S C I M  Multimedia Technology -
>       - http://www.scim.net      | God is real until  -
>       - mailto:mlangho@scim.net  | declared integer   -