New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@endeo/input

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@endeo/input

Helps decode operation extract values from a buffer.

  • 0.3.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

@endeo/input

Build Status Dependency Status npm version Coverage Status

Helps extract values from a buffer during decoding.

See packages:

  1. endeo
  2. debyte

Install

npm install --save @endeo/input

Usage

// get the builder
var Input = require('@endeo/input')

// build one with buffer/index
var input = new Input({
  buffer: someBuffer,
  index : 0
})

// look at the next byte without advancing index:
var byte = input.peek()

// advance index one passed the one we peeked at:
input.eat()

// get the next byte and advance index:
byte = input.byte()

// backup an index and return itself:
// useful if you want to backup one and pass input on...
input.back()

// check if we have another byte available
input.hasByte()

// check if we have a set number of bytes available:
input.hasBytes(5)

// get a two byte int value:
input.short()

// get an int from next 1 to 6 bytes:
input.int(4) // accepts 1-6

// get 4 byte floating point number:
input.float4()

// get 8 byte floating point number:
input.float8()

// get a string using the specified byte count:
input.string(12)

// get a buffer slice the size specified:
input.bytes(8)

MIT License

FAQs

Package last updated on 21 May 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

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