Split hex into separate components (#7)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// @flow
|
||||
|
||||
const isHex = require('../is/hex');
|
||||
const { stripHexPrefix } = require('../hex');
|
||||
const hexStripPrefix = require('../hex/stripPrefix');
|
||||
|
||||
const EMPTY_BUFFER = Buffer.from([]);
|
||||
|
||||
@@ -15,5 +15,5 @@ module.exports = function fromHex (value?: string): Buffer {
|
||||
throw new Error(`Cannot convert non-hex value '${value}' to Buffer`);
|
||||
}
|
||||
|
||||
return Buffer.from(stripHexPrefix(value), 'hex');
|
||||
return Buffer.from(hexStripPrefix(value), 'hex');
|
||||
};
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
// @flow
|
||||
|
||||
const isBuffer = require('../is/buffer');
|
||||
const { addHexPrefix } = require('../hex');
|
||||
const hexAddPrefix = require('../hex/addPrefix');
|
||||
|
||||
const ZERO_HEX = '0x';
|
||||
|
||||
@@ -15,7 +15,7 @@ module.exports = function toHex (value?: Buffer): string {
|
||||
throw new Error(`Cannot convert non-buffer to hex`);
|
||||
}
|
||||
|
||||
return addHexPrefix(
|
||||
return hexAddPrefix(
|
||||
value.toString('hex')
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user