如何将V8::Value转换为二进制字符串
How to convert V8::Value to binary string?
I post buffer(nodejs buffer) in function:
Handle<Value> some::encrypt_buf (const Arguments& args) {
String::AsciiValue abuf(args[0]->ToString());
cout<<abuf.length()<<endl;
char *buf=*abuf;
...
}
如果buffer中有像 这样的字符,会得到错误的长度。如何获得所有二进制字符abuf
和正确的长度()?也许存在最好的方式直接转换V8::值char*和长度?
我决定这么做
#include <node_buffer.h>
...
Handle<Value> some::encrypt_buf (const Arguments& args) {
int len=node::Buffer::Length(args[0]->ToObject());
char *buf=Node::Buffer::Data(args[0]->ToObject());
...
}
为什么没有这个的官方文档?: - https://www.google.ru/webhp?q=%22node:缓冲::数据% 22 +网站:nodejs.org
相关文章:
- 查找"n"二进制字符串中最长公共子字符串的长度
- 如何在C ++中将二进制字符串128位转换为十进制字符串?
- 如何排列二进制字符串以最小化它们之间的距离
- 将二进制字符串/文件内容从 c++ 传递到节点 js
- C++ 将二进制字符串转换为整数或比较 2 个字符串以查找差异数
- 将大型二进制字符串写入二进制文件
- 将浮点数向量转换为十六进制/二进制字符串
- 我如何在二进制字符串中解开KTH集位
- 在 c++ 中将负 int 转换为二进制字符串
- 将二进制字符串转换为十进制
- 在二进制字符串的数字之间留出空间
- 将整数转换为二进制字符串
- 如何将二进制字符串转换为 ASCII 字符串
- C ++检查字符串是否包含字符以及如何将二进制字符串转换为整数
- 在 C/C++ 中将非常大的 int(写为字符串)转换为二进制字符串
- 如何将二进制字符串转换为整数字符串
- 将二进制字符串转换为整数字符串c++
- 构建一个二进制字符串c++
- 这是从二进制字符串转换为十进制值的无效方法吗?
- 将二进制字符串写入二进制文件