import { fromStringToCharCodes } from './fromStringToCharCodes'
// @NOTE @TODO @FIXME @HACK - WAS UINT31 ADD IT BACK
const add = (a, b) => a + b
const numbersToUint31 = (numbers: number[]) => numbers.reduce(add, 0)
// fromStringToCharCodes(x.toLowerCase())
const stringToUint31 = (x: string | number): number =>
numbersToUint31(fromStringToCharCodes(x as string))
// numbersToUint31(x.toLowerCase().split('').map(char => char.charCodeAt(0)))
/**
* @since 5.0.0-beta.9
* @name fromStringToUint31
* @type {Function}
*/
export default stringToUint31
export { stringToUint31 }