我正在 PHP 编码中实现 REST Web 服务 API,该 Web 服务的有效负载大小限制为 200kb。我如何能够计算 post json 数据大小或 json 数据大小的有效负载。所以,我确实需要计算有效负载大小,我使用 json 数据作为帖子类型。
示例编码: @curl_setopt($chaccess, CURLOPT_POST, true); @curl_setopt($chaccess, CURLOPT_POSTFIELDS, $post_json);
我在php中有sha1加密编码
<?php
echo hash('sha1', 'testing'.'abcdb');
?>
Run Code Online (Sandbox Code Playgroud)
但是,我的要求应该是运行页面xyz.html,因此上述代码块无法正常工作。
因此,我需要在jquery / javascript中进行sha1加密。通过提供用于sha1加密的编码来帮助我。
这正是必须转换为脚本
'<?php echo hash('sha1', 'my-secret-key' . $_REQUEST["email"]); ?>'
Run Code Online (Sandbox Code Playgroud)