Socket
Socket
Sign inDemoInstall

byte-o-yob

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    byte-o-yob

Integer to byte string/array conversion


Version published
Maintainers
1
Install size
10.3 kB
Created

Readme

Source

Converting integer to byte string/array

Installation

npm i --save byte-o-yob

Usage

const yoba = require('byte-o-yob');

let bytesString = yoba.uint_16_t_to_bytes_s(12345);

Functions

uint_16_t_to_bytes_s(int)

Converts short int to 2 byte string

uint_16_t_to_bytes_a(int)

Converts short int to 2 byte array of int

uint_32_t_to_bytes_s(int)

Converts int to 4 byte string

uint_32_t_to_bytes_a(int)

Converts int to 4 byte array of int

uint_from_s(str)

Converts any string(only byte char allowed) to integer

uint_from_a(array of bytes)

Converts array of bytes to integer

hexDecode(str)

Converts hex decoded string to common string

hexEncode(str)

Converts common string to hex encoded

string_dump(str)

Returns array of hex bytes

Features

  • Doesn't work with long int.
  • No external dependencies

FAQs

Last updated on 06 Mar 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc