Socket
Socket
Sign inDemoInstall

buf

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    buf

Auto buffer and unbuffer values.


Version published
Weekly downloads
1.7K
decreased by-53.34%
Maintainers
1
Install size
18.4 kB
Created
Weekly downloads
 

Readme

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

Last updated on 19 Jun 2017

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