@stdlib/array-byte-orders
v0.1.1
Published
List of byte orders.
Readme
byteOrders
List of byte orders.
Installation
npm install @stdlib/array-byte-ordersUsage
var byteOrders = require( '@stdlib/array-byte-orders' );byteOrders()
Returns a list of byte orders.
var out = byteOrders();
// e.g., returns [ 'little-endian', 'big-endian' ]The output array contains the following orders:
- little-endian: bytes are ordered from least-to-most significant byte.
- big-endian: bytes are ordered from most-to-least significant byte.
Examples
var contains = require( '@stdlib/array-base-assert-contains' ).factory;
var byteOrders = require( '@stdlib/array-byte-orders' );
var isByteOrder = contains( byteOrders() );
var bool = isByteOrder( 'little-endian' );
// returns true
bool = isByteOrder( 'big-endian' );
// returns true
bool = isByteOrder( 'beep' );
// returns falseNotice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
