Would be cool to see WASM bindings for this here https://github.com/dqbd/tiktoken
Or maybe even your speedups from "b" in the pure js implementation