S
S
Sergey2018-10-17 13:08:16
Yii
Sergey, 2018-10-17 13:08:16

Method in yii2 for reversible encryption whose result is no longer than 255?

For a secure transaction, you need to encrypt the checkout id so that it is not simply replaced in the response url.
checkout id - integer.
Yii2 has Yii::$app->getSecurity()->encryptByPassword() methods.
But the resulting string is long and bank gateway does not eat it.
You need a value of no more than 255 characters, which can be reversed.
What would you recommend using the Yii framework or just php functions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Abdula Magomedov, 2018-10-17
@butteff

It can be so. Table with 2 columns. checkout_id , hash .
A hash

\Yii::$app->security->generateRandomString($length);

when you get the answer, you pull out the id by hash.
https://www.yiiframework.com/doc/api/2.0/yii-base-...
Or store in files. The name of the file is hash , and the content is id .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question