JSFiddle - React, Tailwind, and code Playground
https://teratail.com/questions/322064
by Lhankor_Mhy
JavaScript
const test = async x =>
new DataView(
await crypto.subtle.digest('SHA-1', new TextEncoder().encode(x))
).getUint8() % 11;
Promise.all([
"hello",
"world",
"hello",
"hi",
"world",
"duplicate",
"duplicate",
].map(test)).then(alert);