convert: remove hex functions
This commit is contained in:
parent
614a213d44
commit
f70ccc9215
2 changed files with 5 additions and 59 deletions
test
|
@ -2,29 +2,6 @@ var assert = require('assert')
|
|||
var convert = require('../').convert
|
||||
|
||||
describe('convert', function() {
|
||||
describe('bytesToHex', function() {
|
||||
it('handles example 1', function() {
|
||||
assert.equal(convert.bytesToHex([0, 1, 2, 255]), '000102ff')
|
||||
})
|
||||
})
|
||||
|
||||
describe('hexToBytes', function() {
|
||||
it('handles example 1', function() {
|
||||
assert.deepEqual(convert.hexToBytes('000102ff'), [0, 1, 2, 255])
|
||||
})
|
||||
})
|
||||
|
||||
it('converts from bytes to hex and back', function() {
|
||||
var bytes = []
|
||||
for (var i=0 ; i<256 ; ++i) {
|
||||
bytes.push(i)
|
||||
}
|
||||
|
||||
var hex = convert.bytesToHex(bytes)
|
||||
assert.equal(hex.length, 512)
|
||||
assert.deepEqual(convert.hexToBytes(hex), bytes)
|
||||
})
|
||||
|
||||
describe('byte array and word array conversions', function(){
|
||||
var bytes, wordArray
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue