Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buf

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buf

Auto buffer and unbuffer values.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
755
increased by5.45%
Maintainers
1
Weekly downloads
 
Created
Source

buf

A simple utility for converting between Strings and Buffers.

var buf = require('buf');

var aBuffer = buf.hex(strOrBuf);
var aString = buf.to.hex(strOrBuf);

API

  • buf(stringOrBuffer, encoding): Buffer - Converts value to a Buffer.
  • unbuf(stringOrBuffer, encoding): String - Converts value to a String
    • aliases: buf.unbuf, buf.un, buf.str, buf.to
  • encoding methods
    • All the encodings that native Buffers can handle are methods on buf and unbuf. These are useful if you'll only ever be using 1 encoding, such as: var buf = require('buf').base64; buf(val).

License

MPLv2.0

Keywords

FAQs

Package last updated on 19 Jun 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