Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the idea of using str_rot13 [closed]

Tags:

string

php

Well, I can't understand what is the purpose of str_rot13 php function. I understand how it works but can't figure out in which situations is suitable for use. Can you give me some examples?

like image 352
dofenco Avatar asked Jun 19 '13 10:06

dofenco


People also ask

What is str_rot13?

str_rot13(string $string ): string. Performs the ROT13 encoding on the string argument and returns the resulting string. The ROT13 encoding simply shifts every letter by 13 places in the alphabet while leaving non-alpha characters untouched.

What does str_ ROT13 do in PHP?

Definition and Usage The str_rot13() function performs the ROT13 encoding on a string. The ROT13 encoding shifts every letter 13 places in the alphabet. Numeric and non-alphabetical characters remains untouched.


1 Answers

In cryptography, a Caesar cipher is one of the simplest and most widely known encryption techniques. -Wikipedia

There is nothing more to it, it's easy to implement and having it in the library wouldn't do harm. It can be used for spoilers (instead of a "show spoiler" button), for trivial encryption (a client-side config file, a hint in an online game), as fancy way to encode your email (avoid spam bots) or just for toying around. However, serious use is highly discouraged (unless you plan on bombing something).

like image 129
a3f Avatar answered Oct 17 '22 07:10

a3f