All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.doc.string_bytes.md Maven / Gradle / Ivy

Go to download

Native Abstractions for Node.js: C++ header for Node 0.8 -> 18 compatibility

There is a newer version: 2.19.0
Show newest version
## Strings & Bytes

Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing.

 - Nan::Encoding
 - Nan::Encode()
 - Nan::DecodeBytes()
 - Nan::DecodeWrite()



### Nan::Encoding

An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node.

Definition:

```c++
enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER }
```



### Nan::Encode()

A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node.

Signature:

```c++
v8::Local Nan::Encode(const void *buf,
                                 size_t len,
                                 enum Nan::Encoding encoding = BINARY);
```



### Nan::DecodeBytes()

A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node.

Signature:

```c++
ssize_t Nan::DecodeBytes(v8::Local val,
                         enum Nan::Encoding encoding = BINARY);
```



### Nan::DecodeWrite()

A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node.

Signature:

```c++
ssize_t Nan::DecodeWrite(char *buf,
                         size_t len,
                         v8::Local val,
                         enum Nan::Encoding encoding = BINARY);
```




© 2015 - 2024 Weber Informatics LLC | Privacy Policy