Socket
Socket
Sign inDemoInstall

endianness

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

endianness - npm Package Compare versions

Comparing version 5.0.0-alpha.3 to 5.0.0-alpha.4

1

index.js

@@ -33,2 +33,3 @@ /*

* @param {number} offset The number of bytes of each unit of information.
* @throws {Error} If the byte array length is not valid.
*/

@@ -35,0 +36,0 @@ function endianness(bytes, offset) {

2

package.json
{
"name": "endianness",
"version": "5.0.0-alpha.3",
"version": "5.0.0-alpha.4",
"description": "Swap endianness in byte arrays.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/rochars/endianness",

@@ -5,3 +5,3 @@ # endianness

[![NPM version](https://img.shields.io/npm/v/endianness.svg?style=for-the-badge)](https://www.npmjs.com/package/endianness) [![Docs](https://img.shields.io/badge/docs-online-blue.svg?style=for-the-badge)](https://rochars.github.io/endianness/index.html)
[![NPM version](https://img.shields.io/npm/v/endianness.svg?style=for-the-badge)](https://www.npmjs.com/package/endianness) [![Docs](https://img.shields.io/badge/docs-online-blue.svg?style=for-the-badge)](https://rochars.github.io/endianness/index.html)
[![Codecov](https://img.shields.io/codecov/c/github/rochars/endianness.svg?style=flat-square)](https://codecov.io/gh/rochars/endianness) [![Unix Build](https://img.shields.io/travis/rochars/endianness.svg?style=flat-square)](https://travis-ci.org/rochars/endianness) [![Windows Build](https://img.shields.io/appveyor/ci/rochars/endianness.svg?style=flat-square&logo=appveyor)](https://ci.appveyor.com/project/rochars/endianness) [![Scrutinizer](https://img.shields.io/scrutinizer/g/rochars/endianness.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/rochars/endianness/)

@@ -24,4 +24,5 @@

<script>
endianness([64, 9, 33, 251, 84, 68, 45, 24], 8);
// returns [24, 45, 68, 84, 251, 33, 9, 64]
var bytes = [64, 9, 33, 251, 84, 68, 45, 24];
endianness(bytes, 8);
console.log(bytes);
</script>

@@ -40,8 +41,10 @@ ```

// Swap endianness of one 64-bit value:
endianness([64, 9, 33, 251, 84, 68, 45, 24], 8);
// returns [24, 45, 68, 84, 251, 33, 9, 64]
bytes = [64, 9, 33, 251, 84, 68, 45, 24];
endianness(bytes, 8);
console.log(bytes);
// Swap endianness of two 24-bit values:
endianness(["00", "00", "80", "ff", "ff", "7f"], 3),
// returns ["80", "00", "00", "7f", "ff", "ff"];
bytes = ["00", "00", "80", "ff", "ff", "7f"];
endianness(bytes, 3),
console.log(bytes);
```

@@ -53,5 +56,6 @@

* Swap the endianness of units of information in a byte array.
* The original array is modified in-place.
* @param {!Array<number>|!Array<string>|Uint8Array} bytes The bytes.
* The original array is modified in place.
* @param {!Array<number|string>|!Uint8Array} bytes The bytes.
* @param {number} offset The number of bytes of each unit of information.
* @throws {Error} If the byte array length is not valid.
*/

@@ -58,0 +62,0 @@ function endianness(bytes, offset) {}

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