Remove unneeded 0 constant (#113)
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
// Copyright 2017-2018 Jaco Greeff
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
// @flow
|
||||
|
||||
const ZEROS_256 = '0000000000000000000000000000000000000000000000000000000000000000';
|
||||
|
||||
module.exports = {
|
||||
ZEROS_256
|
||||
};
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
const hexAddPrefix = require('./addPrefix');
|
||||
const hexStripPrefix = require('./stripPrefix');
|
||||
const { ZEROS_256 } = require('./constants');
|
||||
|
||||
/**
|
||||
@name hexFixLength
|
||||
@@ -37,6 +36,6 @@ module.exports = function hexFixLength (value: string, bitLength: number = -1, w
|
||||
}
|
||||
|
||||
return hexAddPrefix(
|
||||
`${ZEROS_256}${hexStripPrefix(value)}`.slice(-1 * strLength)
|
||||
`${'0'.repeat(strLength)}${hexStripPrefix(value)}`.slice(-1 * strLength)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user