SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How would I express this in Ruby?

    How would I express this line in Ruby?

    PHP

    Code:
    $output.= chr(ord(substr($InString, $i, 1)) ^ ($KeyList[$i % strlen($Key)]));
    ASP
    Code:
    strReturn = strReturn & chr( asc(mid(strIn,iInIndex,1)) XOR asc(mid(strKey,iKeyIndex,1)))

  2. #2
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got their in the end thanks to L7Sqr @ Devshed

    Code:
    output << (str[i] ^ key[i % key.size]).chr
    http://forums.devshed.com/ruby-progr...by-535351.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •