Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Crypto rot13 and numbers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Crypto rot13 and numbers

    Can anyone help me in encryting number using the rot13?

    I have had it for ages and never tested it with numbers, now I desperatley need to encrypt numbers with it.

    please help.

    Thanks in advance.

  • #2
    ROT13 focuses on alphabetic characters only, rotate alphabet 13 characters. After you run your string through the rot13 encryption you can create your own function to take care of the numbers.

    There might be a better way but you can try this, it should only convert numbers.

    Code:
    function RotN5(strEncryptMe)
    	local stroutput = "";
    	for x = 1, String.Length(strEncryptMe) do
    		local num = String.Asc(String.Mid(strEncryptMe)
    		if num > 48 and num < 52 then
    			num = num+5;
    		elseif num > 53 and < 57 then
    			num = num-5;
    		end
    		stroutput = stroutput .. String.Char(num);
    	end
    	return stroutput;
    end
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment

    Working...
    X