buffer-codec
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"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. | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
39174
121
0