CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-base64url

For encoding to/from base64urls implementing RFC 4648 base64url standard

89

1.28x
Overview
Eval results
Files

task.mdevals/scenario-1/

URL Token Builder

Create a small helper that turns text or binary input into URL-safe base64 tokens by relying on the dependency's callable default export.

Capabilities

Encodes plain text

  • Given the text "hello world" the helper returns "aGVsbG8gd29ybGQ" using the dependency's callable default export. @test

Accepts buffers directly

  • Given a Buffer created from "hello world" the helper returns "aGVsbG8gd29ybGQ" without requiring the caller to specify encoding. @test

Respects explicit encodings

  • Given the single-byte string "\xff" with an explicit input encoding of "binary", the helper returns "_w" using the dependency's callable form rather than manual conversion. @test

Implementation

@generates

The implementation must delegate base64url conversion to the package's default callable export instead of reimplementing the algorithm or using its other helpers.

API

export function createUrlToken(input: string | Buffer, encoding?: BufferEncoding): string;

Dependencies { .dependencies }

base64url { .dependency }

Provides URL-safe base64 conversion via its callable default export.

Install with Tessl CLI

npx tessl i tessl/npm-base64url

tile.json