New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bytey

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

bytey

Simple byte-array conversion utility.

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
13
Maintainers
1
Weekly downloads
 
Created
Source

bytey

A simple JavaScript/NodeJS module that provides byte-array utility.

Installing

Browser

<script type="text/javascript" src="bytey.js"/>

Node JS

npm install bytey

Usage

// In NodeJS, import the module.
const bytey = require('bytey');

// Convert hex string to byte-array.
 bytey.hexStringToByteArray('683628F9EDB5E9D1');
// -> [ 104, 54, 40, 249, 237, 181, 233, 209 ]

// Convert a byte-array to a hex string.
bytey.byteArrayToHexString([104, 54, 40, 249, 237, 181, 233, 209]);
// -> '683628f9edb5e9d1'

// Convert UTF8 string to byte-array.
bytey.utf8ToByteArray('こんにちは');
// -> [ 227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175 ]

// Convert byte-array to UTF8 string.
bytey.byteArrayToUtf8([227, 129, 147, 227, 130, 147, 227, 129, 171, 227, 129, 161, 227, 129, 175]);
// -> 'こんにちは'

// Check if two byte arrays are equals.
bytey.isByteArrayEqual([200, 55, 24], [200, 54, 24]);
// -> false

Keywords

byte

FAQs

Package last updated on 14 Dec 2017

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