Skip to content

Commit 770fa68

Browse files
refactor: remove "reduce" from function name as nothing is reduced
1 parent 18b61c0 commit 770fa68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/helpers/aerArmonBase.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const encode = (input, options) => {
33
throw Error('Key is too short! It must be at least 3 characters')
44
}
55

6-
const heyKey = [...options.key].map(reduceToHexCharCodeConcatenationNumber)
6+
const heyKey = [...options.key].map(toHexCharCodeConcatenationNumber)
77

88
const chunkedString = input.match(new RegExp(`.{1,${Math.round(options.key.length / 2)}}`, 'g'))
99

@@ -25,7 +25,7 @@ const encode = (input, options) => {
2525
acc *= 0.01 * heyKey[i]
2626
}
2727
return acc
28-
}, reduceToHexCharCodeConcatenationNumber(s))
28+
}, toHexCharCodeConcatenationNumber(s))
2929
).join(options.isAer256 ? ', ' : '+')
3030
}
3131

@@ -34,7 +34,7 @@ const decode = (input, options) => {
3434
throw Error('Key is too short! It must be at least 3 characters')
3535
}
3636

37-
const hexKey = [...options.key].map(reduceToHexCharCodeConcatenationNumber)
37+
const hexKey = [...options.key].map(toHexCharCodeConcatenationNumber)
3838

3939
const keyLengthRangeReversed = Array.from(new Array(options.key.length), (v, i) => i).reverse()
4040

@@ -69,7 +69,7 @@ const decode = (input, options) => {
6969
* Map each character to hex representation of it's char code, join them together and then retrieve a decimal number
7070
* out of the concatenated hex string.
7171
*/
72-
const reduceToHexCharCodeConcatenationNumber = c => parseInt([...c].map(x => {
72+
const toHexCharCodeConcatenationNumber = c => parseInt([...c].map(x => {
7373
const hexCharCode = x.charCodeAt(0).toString(16)
7474
if (hexCharCode.length > 2) {
7575
throw Error('Invalid character')

0 commit comments

Comments
 (0)