C
C
cjitkul332017-12-30 11:08:20
PHP
cjitkul33, 2017-12-30 11:08:20

How to make a reversible encryption of a number?

You need to reversibly encrypt a number of type int.
So that at the same time it remains a number of type int. Those. so that (int)$x does not break this very reversibility.
Googled, did not find ready-made options.
PHP 5.5.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Kornilov, 2017-12-30
@cjitkul33

As an option:

$int = 252525252;
$key = 7;
echo "<br>$int";
$enc = $int<<$key;
echo "<br>$enc";
$dec = $enc>>$key;
echo "<br>$dec";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question