Php change a number into another number that can be changed back to the original

后端 未结 2 824
孤街浪徒
孤街浪徒 2021-01-26 08:04

Using PHP, I\'m trying to encode a number into another number that I can decode back to the original number. The encoded string needs to be only numbers and should not contain a

2条回答
  •  遥遥无期
    2021-01-26 08:39

    Why not using a mathematicat operation on the original number? like x becomes x * y + z. you would only have to make the reverse operation to get the original number. consider using large enough prime numbers for y and/or z

提交回复
热议问题