convert: remove reverseEndian
This commit is contained in:
parent
3b988a0872
commit
27f9e7dc1e
2 changed files with 1 additions and 18 deletions
|
@ -26,15 +26,7 @@ function wordArrayToBuffer(wordArray) {
|
|||
return buffer
|
||||
}
|
||||
|
||||
function reverseEndian(hex) {
|
||||
var buffer = new Buffer(hex, 'hex')
|
||||
Array.prototype.reverse.call(buffer)
|
||||
|
||||
return buffer.toString('hex')
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
bufferToWordArray: bufferToWordArray,
|
||||
wordArrayToBuffer: wordArrayToBuffer,
|
||||
reverseEndian: reverseEndian
|
||||
wordArrayToBuffer: wordArrayToBuffer
|
||||
}
|
||||
|
|
|
@ -24,13 +24,4 @@ describe('convert', function() {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('reverseEndian', function() {
|
||||
it('works', function() {
|
||||
var bigEndian = "6a4062273ac4f9ea4ffca52d9fd102b08f6c32faa0a4d1318e3a7b2e437bb9c7"
|
||||
var littleEdian = "c7b97b432e7b3a8e31d1a4a0fa326c8fb002d19f2da5fc4feaf9c43a2762406a"
|
||||
assert.deepEqual(convert.reverseEndian(bigEndian), littleEdian)
|
||||
assert.deepEqual(convert.reverseEndian(littleEdian), bigEndian)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue