Generation

generate functionSat, 12 Nov 2022

Hash an input string to a number

function hash(str: string): number { return str.split('').reduce((accum, char) => accum + char.charCodeAt(0), 0); }

TypeScript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code