简体   繁体   English

什么是在网站链接中编码参数的最佳方法

[英]What is the best way to encode parameters in website link

What is the best way to encode and decode parameters in website link? 在网站链接中编码和解码参数的最佳方法是什么?

I need encode user id by android or ios system and send this parametr to PHP server. 我需要通过android或ios系统对用户ID进行编码,然后将此参数发送到PHP服务器。

For example: www.example.com/getData.php?uid=[encode id] 例如: www.example.com/getData.php?uid=[encode id]

Mobiles -> encode 手机->编码
Server -> decode 服务器->解码

I am looking for a good algorithm for all platforms (Android, iOS and PHP). 我正在寻找适用于所有平台(Android,iOS和PHP)的良好算法。

I recommend reading The Comprehensive Guide to URL Parameter Encryption . 我建议阅读《 URL参数加密综合指南》

Don't Do This: 不要这样做:

不加密URL参数。

Do This Instead: 改为这样做:

请使用随机生成的ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM