Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffer-codec

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-codec - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "buffer-codec",
"version": "1.0.0",
"version": "1.0.1",
"description": "add the codec ability to abstract-nosql database.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/snowyu/node-buffer-codec",

@@ -11,6 +11,4 @@ # AbstractCodec

* name: the codec name.
* encode(value): encode the value. return the encoded string.
* decode(value): the value is string/buffer. return the the decoded value.
* encodeString(value): encode the value. return the encoded string.
* decodeString(value): decode the string(value). return the decoded value.
* decodeString(aString): decode the string(value). return the decoded value.
* encodeBuffer(value, destBuffer, offset=0, encoding='utf8'):

@@ -108,1 +106,17 @@ * encode value to the destBuffer. return the encoded length.

```
## Codec List:
* Text Codec: encode via toString() , decode return the data directly.
* Json Codec: encode via JSON.stringify(.toJSON), decode via JSON.parse
* Binary Codec:
* encodeBuffer: encode string or array to a buffer.
* decodeBuffer: return the buffer directly.
* encodeString:
* result is the same string if value is string
* result is ascii string if value is array, the number element in array saved is (element & 0xFF)
if element is not number, saved 0 instead.
* decodeString: return the same string.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc