Socket
Socket
Sign inDemoInstall

@stdlib/array-uint16

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/array-uint16

Uint16Array.


Version published
Weekly downloads
448K
decreased by-3.87%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/array-uint16?

@stdlib/array-uint16 is a package that provides utilities for creating and manipulating unsigned 16-bit integer arrays. It is part of the larger @stdlib library, which offers a wide range of mathematical, statistical, and utility functions.

What are @stdlib/array-uint16's main functionalities?

Creating a Uint16Array

This feature allows you to create a new Uint16Array from an array of numbers. The resulting array will contain unsigned 16-bit integers.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
console.log(arr);

Accessing Elements

This feature allows you to access elements in the Uint16Array using standard array indexing.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
console.log(arr[0]); // 1
console.log(arr[1]); // 2

Setting Elements

This feature allows you to set elements in the Uint16Array using standard array indexing.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
arr[0] = 10;
console.log(arr); // Uint16Array [ 10, 2, 3, 4 ]

Typed Array Methods

This feature allows you to use standard TypedArray methods like subarray to manipulate the Uint16Array.

const uint16Array = require('@stdlib/array-uint16');
const arr = uint16Array([1, 2, 3, 4]);
const subArray = arr.subarray(1, 3);
console.log(subArray); // Uint16Array [ 2, 3 ]

Other packages similar to @stdlib/array-uint16

Keywords

FAQs

Package last updated on 14 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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