Skip to content

Instantly share code, notes, and snippets.

@jbenet
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbenet/3c0392fb8621c6bda181 to your computer and use it in GitHub Desktop.
Save jbenet/3c0392fb8621c6bda181 to your computer and use it in GitHub Desktop.
ip string to buffer
var transformer = require('dat-transformer');
var str2buf = transformer('ip-address', 'ip-address-buffer');
console.log(str2buf('127.0.0.1'));
// <Buffer 7f 00 00 01>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment