Convert to/from hex string and array of bytes
npm install convert-hexconvert-hex
===========
JavaScript component to convert to/from hex strings and byte arrays.
AMD/CommonJS compatible.
Install
-------
npm install --save cryptocoin-convert-hex
component install cryptocoin/convert-hex
bower install cryptocoin/convert-hex
``html`
Usage
-----
(if using script, the global is convertHex)
`js
var convertHex = require('convert-hex')
var bytes = [0x34, 0x55, 0x1, 0xDF]
console.log(convertHex.bytesToHex(bytes)) //"345501df"
`
`js``
var hex = "34550122DF" //"0x" prefix is optional
console.dir(conv.hexToBytes(hex).join(',')) //'[52,85,1,34,223]'
Credits
-------
Loosely inspired by code from here: https://github.com/vbuterin/bitcoinjs-lib & CryptoJS
License
-------
(MIT License)
Copyright 2013, JP Richardson