hd-utils
Version:
A handy utils for modern JS developers
10 lines (9 loc) • 378 B
JavaScript
import getAsciiSumFromString from './getAsciiSumFromString';
/**
* @description It takes a string, converts it to an array of ASCII codes, sums them up, and returns the sum
* @param {string} str - The string to hash
* @returns The sum of the ASCII values of the characters in the string.
*/
export default function hashString(str) {
return getAsciiSumFromString(str);
}