亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

In PHP language, the C# ASCII code equivalent is expressed as
P粉680087550
P粉680087550 2023-07-17 18:27:57
0
1
735

I want to implement this code for bank payment in PHP. Can anyone help me? Thanks.

ASCIIEncoding ByteConverter = new ASCIIEncoding();

string dataString = "Data to Sign";
?
byte[] originalData = ByteConverter.GetBytes(dataString);

byte[] signedData;

RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider();

String PrivateKey= File.ReadAllText(Application.StartupPath + "PrivateKey.xml");

RSAalg.FromXmlString(PrivateKey);

signedData = Key.SignData(originalData,SHA1.Create());

String base64String = Convert.ToBase64String(signedData, 0, signedData.Length);
?

I've tried this but didn't get any results. Due to a problem with the request, I got a symbol error.

$baseString = "Data to Sign";
$signedData = null;
$privateKey = file_get_contents(config_path("PrivateKey.pem"));
$privateKeyResource = openssl_pkey_get_private($privateKey);

$signature = null;

if (openssl_sign($baseString, $signedData, $privateKeyResource, OPENSSL_ALGO_SHA1))
            $signature = base64_encode($signedData);


P粉680087550
P粉680087550

reply all(1)
P粉674876385


我猜測數(shù)據(jù)字符串/基本字符串的編碼錯誤。

在C#中,默認的字符串編碼是UTF-16,在php中,字符串的編碼自動為ASCII,但是如果字符串中出現(xiàn)不支持的字符,則編碼會自動更改為UTF-8 - 所以這取決于$baseString包含的字符串,您可以使用mb_detect_encoding方法檢查編碼是否仍然是預期的ASCII編碼。


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template