I printed every single variable already. First of all the crypt($pw,"Ho") statement returns different results. After I noticed that, I just set $pw to the value the c tool returns. Now $seed differs from the c code. It's wierd because the first 4-5 elements in the array are the same like in the c tool.

Hexadecimal elements from @seed in Perl:
seed: 2298 seed: effe9 seed: 329fb28 seed: f9f4815b seed: 7430a82151 seed: 277c8923528c seed: 11957511bac25e seed: 6a9a15bb7c3a5a5 seed: 53cb25459bf9ffe7 seed: 59b3b95dcd77f57d seed: a56ffe811a5b3cae seed: 4ffb834f11b60ab seed: 52dea09c13b9ef89

Hexadecimal elements from seed in C:

c: seed: 2298 c: seed: effe9 c: seed: 329fb28 c: seed: f9f4815b c: seed: 30a82151 c: seed: 8923528c c: seed: 11bac25e c: seed: b7c3a5a5 c: seed: 9bf9ffe7 c: seed: cd77f57d c: seed: 1a5b3cae c: seed: f11b60ab c: seed: 13b9ef89

I have no clue why the values differs from the 5th element on. Thats why I'm asking here. Sorry for my incomprehensible question befor.

regards bottch


In reply to Re^2: C code translation to Perl by bottch
in thread C code translation to Perl by bottch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.