Public
Edited
Oct 31, 2023
Insert cell
Insert cell
Insert cell
Insert cell
function getHash(key) {
const b = key.length;
const c = key.split("").map((k) => abc.findIndex((ab) => ab === k))[0];
const d =
key
.split("")
.map((k) => findNthPrime(abc.findIndex((ab) => ab === k) + 1))
.reduce((acc, cv) => acc + cv, 0) % 10;
return { b, c, d };
}
Insert cell
Insert cell
[getHash("esther"), getHash("ben"), getHash("bob"), getHash("dan")]
Insert cell
Insert cell
[getHash("a"), getHash("aa"), getHash("aaa"), getHash("aaaa")]
Insert cell
Insert cell
[getHash("maus"), getHash("fun home"), getHash("watchmen")]
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more