Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以追加PHP-DEMO吗 #45

Open
13670365604 opened this issue Apr 21, 2023 · 3 comments
Open

可以追加PHP-DEMO吗 #45

13670365604 opened this issue Apr 21, 2023 · 3 comments

Comments

@13670365604
Copy link

可以追加PHP-DEMO吗

@axguowen
Copy link

这个我支持···搞个PHP SDK····

@tullyliu
Copy link
Member

暂无计划。

@lidongyooo
Copy link

PHP签名验证:

    protected function paramsSign($params): string
    {
        $secretKey = config('custom.baidu.secret_key');
        $json = trim(json_encode($params));
        $str_padded = trim(base64_encode($json));
        if (strlen($str_padded) % 16) {
            $str_padded = str_pad($str_padded, strlen($str_padded) + 16 - strlen($str_padded) % 16, "\0");
        }
        return strtoupper(bin2hex(openssl_encrypt($str_padded, 'AES-128-CBC', substr($secretKey, 0, 16), OPENSSL_NO_PADDING, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")));
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants