Open this example in the interactive library
Source code
import { Buffer } from "node:buffer";
const token = Buffer.from([251, 255]).toString("base64url");
console.log(token, [...Buffer.from(token, "base64url")]);
Sample output
-_8 [ 251, 255 ]

Open this example in the interactive library
import { Buffer } from "node:buffer";
const token = Buffer.from([251, 255]).toString("base64url");
console.log(token, [...Buffer.from(token, "base64url")]);
-_8 [ 251, 255 ]