Remove unneeded 0 constant (#113)

This commit is contained in:
Jaco Greeff
2018-04-11 10:55:19 +02:00
committed by GitHub
parent 6c9885858a
commit 985ea40b45
4 changed files with 9 additions and 20 deletions
-10
View File
@@ -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
};
+1 -2
View File
@@ -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)
);
};