我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何将以下Node.js加密缓冲区转换为PHP?

I am having some hard time figuring out how to convert the following code to PHP;

const envelope = JSON.stringify({ v: value, a: Cryptiles.randomString(2) });
const cipher = Crypto.createCipher('aes256', key);

let enc = cipher.update(envelope, 'utf8', 'binary');
enc += cipher.final('binary');

return (new Buffer(enc, 'binary')).toString('base64').replace(/\+/g, '-').replace(/\//g, ':').replace(/\=/g, '');

Any thoughts?

近期文章

  • 如何在Java和PHP之间建立通信?
  • wp_insert_link什么都没显示
  • 用于简单查询的Codeigniter活动记录
  • 简单的html dom过滤器表单获取名称和值为php数组
  • 即使在发送电子邮件后,PHP联系表也不会发送电子邮件
  • 如何使用PHP获取两个日期之间的明智日期?
  • PHP SMTP邮件需要在sitemailxchange.gate.com上配置我的代码是否正确
  • 如何在MySQL中插入多行而不使用预准备语句插入空行
  • 如何用$ nin实现搜索
  • 如何通过php中为oauth形成的url获取代码
  • 使用pdo php执行过程后,bindparam变量的值为零
  • 致命错误:Class'Requests_Cookie'
  • PHPUnit Guzzle响应不起作用
  • 缺少wp_insert_term()的参数4
  • 如何通过其中一行订购MySQL?
  • 发布类别重定向问题
  • Ajax表单发送错误
  • 验证域名发送电子邮件
  • 反射异常类不存在
  • CodeIgniter:数据库连接不稳定

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华