04 2017 档案

[PHP] 接口请求校验的原理
摘要:具体的校验步骤可以自定义,下面是比较直观的一种形式: 1. 客户端:请求参数带上时间,进行首字母排序,连接私钥后,取得加密结果; 客户端请求时带上这个加密结果作为sign参数。 2. 服务端:对sign参数进行校验(过程同上),如果正确且在有效期内,则通过。 示例程序: <?php /** * Si 阅读全文

posted @ 2017-04-12 18:02 ercom 阅读(2032) 评论(0) 推荐(0)

[codility] Lession1 - Iterations - BinaryGap
摘要:Task1: A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary rep 阅读全文

posted @ 2017-04-03 23:46 ercom 阅读(762) 评论(0) 推荐(0)