惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
S
SegmentFault 最新的问题
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
I
InfoQ
U
Unit 42
博客园_首页
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
罗磊的独立博客
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
DataBreaches.Net
aimingoo的专栏
aimingoo的专栏
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 聂微东
T
Tailwind CSS Blog
量子位

Lua

用 Lua 写 Android 应用? AutoLua 做到了 Android 上直接用 Lua 调 Java API 写脚本——AutoLua 技术分享 使用 Android Lua Helper 在 VSCODE 中调试安卓 Lua 应用 奇怪的小问题 Lua 代码上的优化,相互学习一下 openresty + lua 这个地方怎么写 求一份 lua 入门教程 有关 Lua 调用 C++ 编译动态库程序 飞书 + Lua 实现企业级组织架构登录认证 为什么游戏架构要用事件来驱动? vscode 上写 lua 有显示注释的插件吗? lua 为什么要使用~=当作不等于运算符? 请问现在 lua 混淆用什么工具,求常年 lua 的老哥指点 lua 的前景如何? core_framework - 基于 libev 的轻量级 lua 网络开发框架 如何构建伪视频流服务? 低延时低采样, 基于 OpenResty , HTTP, 内网... TP-Link 官方使用的是开源固件? 表达过去、现在与将来:之将来(1) 有个问题, lua 平时能用来做做什么 ngx_lua 遇到的一个小坑 Lua IDE 各位 V 友,用 lua 作为开发语言用什么 IDE 可以方便代码提示以及调试呢 Lua 怎么实现 php strstr() 函数的功能 使用 Sol2 来进行 Lua 绑定 luarocks 使用上的一些小技巧 正在用 lua 写一个 nginx 防盗链的拓展,遇到了一个问题。 9k-18k 宁波 经验 3-5 年 本科及以上 全职 职位诱惑 : 年终奖 出国旅游 顶级办公设备及环境 关于 Lua 的标准库 Torch 一个在 MediaWiki 里面加入 Lua 脚本的插件 ngx_lua_reqstatus 实时监控 Nginx 域名 qps 的 lua 拓展
skynet 怎么给 mysql drive 增加对 caching_sha2_password 的...
awanganddong · 2025-03-10 · via Lua

mysql 用的是 8.0 。插件是 caching_sha2_password

skynet 默认扩展不支持这种模式。 所以想请教下这种怎么改写。 也看了 https://github.com/openresty/lua-resty-mysql 源码。还是一脑袋浆糊。

        if auth_plugin == "caching_sha2_password" then
            token = _compute_caching_sha2_password_token(password, scramble)
        else
            token = _compute_token(password, scramble)
        end
        local client_flags = 260047
        local req = strpack("<I4I4c1c23zs1z",
                client_flags,
                self._max_packet_size,
                strchar(charset),
                strrep("\0", 23),
                user,
                token,
                database
        )
        local authpacket = _compose_packet(self, req)
        sockchannel:request(authpacket, dispatch_resp)
        if on_connect then
            on_connect(self)
        end
        
        
        
        function _compute_caching_sha2_password_token(password, scramble)
    -- 1. Compute SHA-256 hash of the password
    local password_hash = sha.sha256(password)

    -- 2. Concatenate the hash with the scramble

    local combined = sha.sha256(sha.sha256(password_hash .. scramble))

    local token = xor(password_hash, combined)
    -- 3. Compute SHA-256 hash of the combined value
    return token
end

下边是我检索 chatgpt 来的,但是不对。请教下大家。