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

legacy-encoding

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

legacy-encoding - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "legacy-encoding",
"version": "1.0.0",
"version": "1.0.1",
"description": "Support as many legacy encodings as possible",

@@ -5,0 +5,0 @@ "files": [

@@ -14,3 +14,3 @@ # legacy-encoding

### `legacy.encode(encoding, input, options)`
### `legacy.encode(input, encoding, options)`

@@ -22,3 +22,3 @@ This function takes a plain text string (the `input` parameter) and encodes it acording the `encoding`. The return value is a 'byte string', i.e. a string of which each item represents an octet as per `encoding`.

var encodedData = legacy.encode(encoding, text);
var encodedData = legacy.encode(text, encoding);
```

@@ -31,3 +31,3 @@

var encodedData = legacy.encode(text, {
var encodedData = legacy.encode(text, encoding, {
'mode': 'html'

@@ -44,6 +44,6 @@ });

var buf = new Buffer(legacy.encode(encoding, text), 'binary');
var buf = new Buffer(legacy.encode(text, encoding), 'binary');
```
### `legacy.decode(encoding, input, options)`
### `legacy.decode(input, encoding, options)`

@@ -55,3 +55,3 @@ This function takes a byte string (the `input` parameter) and decodes it according to `encoding`.

var text = legacy.decode(encoding, encodedData);
var text = legacy.decode(encodedData, encoding);
```

@@ -62,3 +62,3 @@

```js
var text = windows1255.decode(encoding, encodedData, {
var text = windows1255.decode(encodedData, encoding, {
'mode': 'fatal'

@@ -75,3 +75,3 @@ });

var text = legacy.decode(encoding, buf.toString('binary'));
var text = legacy.decode(buf.toString('binary'), encoding);
```

@@ -78,0 +78,0 @@

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