Advice on id encryption in URL (avoid random calls and modifications)

1, guid is used to solve the problem at first, but in EF, if guid is returned directly, because it cannot be decrypted, you have to check it in the database first and then change it. This is the conventional way, but for the sake of efficiency and do not want to query, it is difficult to modify
2. Now you are thinking of reversible encryption and decryption of id and transmission of encrypted ID. You are thinking of methods such as DES, but you are not familiar with
3 for encryption and decryption. Is there a more convenient method for integer ID reversible encryption and decryption

now?

https://hashids.org/
you deserve to have.
can generate fixed-length strings based on the secret key.

the business logic can remain unchanged. (assume that your data interaction format is JSON)
1, the string ending with id in the request layer is the number
2, and all the variables ending in the response layer id are encrypted as strings

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3708e-2c06d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3708e-2c06d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?