LIXI.FUN
0%

对接 C++ 某加解密接口

1
2
3
4
5
// 定义了 KEY 是一个长度为 32 的字符串
#define KEY "01234567890123456789012345678901"

// 其中调用了
EVP_aes_128_cfb128()

AES is based on a design principle known as a substitution–permutation network, and is efficient in both software and hardware.[9] Unlike its predecessor DES, AES does not use a Feistel network. AES is a variant of Rijndael, with a fixed block size of 128 bits, and a key size of 128, 192, or 256 bits. By contrast, Rijndael per se is specified with block and key sizes that may be any multiple of 32 bits, with a minimum of 128 and a maximum of 256 bits.

维基百科 - AES

根据维基百科里的说法,AES 的 key size 只支持 128 bits, 192 bits, 256 bits

阅读全文 »

1
2
3
4
5
6
7
8
select
id,
min(create_time),
create_by
from
t_result
group by
id;

初见这条 sql,认为不能运行,create_by 字段既没有在 group by 中,也没有聚合函数作用,怎么就能运行呢?

直到看到了运行的图。。。

阅读全文 »

比较朴素的做法

前端发送请求分页的必要数据

1
2
3
4
{
pageNum: 1,
pageSize: 10,
}

后端接收这几个参数

1
2
3
4
5
6
public class Param {
// 其他参数
// ...
private Integer pageNum;
private Integer pageSize;
}
阅读全文 »

Debug your app, not your environment.

示例

1
2
3
4
5
6
7
docker run -it \
--rm \
-v `pwd`:/app \
-w /app \
-p 80:80 \
node:14.15.4 \
sh -c "npm install && npm run dev"
阅读全文 »

主要原理

前端

1
2
<!-- 其中的 download 提示浏览器下载而不是打开 -->
<a href="http://xxxx.com/yyy.txt" downlod="yyy.txt"></a>

后端

后端的设置主要是为了当浏览不支持 download 属性的时候的兼容性。

1
2
3
res.setContentType("application/octet-stream");
res.addHeaders("Content-Disposition", "attachment;filename=" + filename);
res.addHeaders("Content-Length", content.length);
阅读全文 »