Public
Edited
Nov 23, 2022
Insert cell
Insert cell
padBlock = (arr, targetLen) => {
const diff = targetLen - (arr.length % targetLen);

const extraBytes = Array(diff).fill().map(() => diff);

return arr.concat(extraBytes);
}
Insert cell
bs = padBlock("YELLOW SUBMARINE".split("").map(lib.atoi), 20)
Insert cell
bs.map(lib.itoa).join("")
Insert cell
import {lib} from "@pcarleton/cryptopals-helpers"
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