New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

visualize-buffer

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

visualize-buffer

generate a visualization of a buffer. for example, to show a public key as a picture.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

visualize-buffer

generate a visualization of a buffer. for example, to show a public key as a picture.

will generate randomly colored grid.

example

var visualize = require('visualize-buffer')
var random = require('crypto').randomBytes

document.appendChild(visualize(random(32), 256))

visualize(buffer, width) => img

will return a square image, with width. Each nibble (4bits) of buffer is represented as a colored square. If Math.sqrt(buffer.length*2) is a whole number, then the buffer will fit perfectly, otherwise, it will have some blocks shown trailing, and be spaced with white.

If you need to fix that, then make a PR, I only needed this for buffers (ed25519 keys) that fit perfectly in a square.

License

MIT

FAQs

Package last updated on 30 Dec 2016

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