pgaultier / vbx-php
PHP的Visual Basic函数回移植
1.0.0
2024-05-16 14:35 UTC
Requires
- php: >=8.0
- ext-mbstring: *
This package is auto-updated.
Last update: 2024-09-16 15:23:20 UTC
README
VB回移植是我们遇到的一套工具,我们在现代化VB5/6旧项目时需要将一些代码移植到PHP。
安装
如果您使用Packagist安装包,则可以像这样更新您的composer.json:
{ "require": { "pgaultier/vbx-php": "*" } }
回移植的组件
Rnd
VB5/6中可用的PRNG Rnd函数在PHP中不可用。
$vbRandomizer = new Rnd(); $vbRandomizer->rnd(-1); $seed = 1500; $vbRandomizer->randomize($seed); $randomNumber = $vbRandomizer->rnd();
ClsEncrypt
原始VB代码由Michael Ciurescu(vbforums.com的CVMichael)创建
https://www.vbforums.com/showthread.php?231798-VB-31-Bit-Encryption-function
$clsEncrypt = new ClsEncrypt(); $password = 'secret key'; $string = 'Hello World'; $encryptedBinaryString = $clsEncrypt->rndCryptLevel2($string, $password); $decryptedString = $clsEncrypt->rndDecryptLevel2($encryptedBinaryString, $password); // $decryptedString == 'Hello World'
贡献
所有代码贡献——包括具有提交访问权限的人的贡献——必须通过拉取请求,并由核心开发者批准后才能合并。这是为了确保对所有代码的正确审查。
将项目分支,创建一个功能分支 ,然后向我们发送拉取请求。