CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-ulid

tessl install tessl/npm-ulid@3.0.0

A universally-unique, lexicographically-sortable, identifier generator

Agent Success

Agent success rate when using this tile

78%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.34x

Baseline

Agent success rate without this tile

58%

task.mdevals/scenario-7/

Binary Data Decoder

A utility that decodes Base32-encoded strings into binary data and compares binary data to verify they match.

Capabilities

Decodes Base32 strings to binary data

  • Decodes the Base32 string "91JPRV3F41BPYWKCCGGG" to a Uint8Array with 12 bytes @test
  • Decodes the Base32 string "0000000000" to a Uint8Array of zeros @test
  • Decoding an empty string returns an empty Uint8Array @test

Compares binary data arrays

  • Comparing two Uint8Arrays with identical bytes [72, 101, 108, 108, 111] returns true @test
  • Comparing two Uint8Arrays with different bytes returns false @test
  • Comparing two empty Uint8Arrays returns true @test

Implementation

@generates

API

/**
 * Decodes a Base32-encoded string into binary data.
 *
 * @param encoded - The Base32-encoded string to decode
 * @returns The decoded binary data as a Uint8Array
 */
export function decodeBase32(encoded: string): Uint8Array;

/**
 * Compares two Uint8Array instances to check if they contain identical bytes.
 *
 * @param a - The first Uint8Array
 * @param b - The second Uint8Array
 * @returns true if both arrays have the same length and identical bytes, false otherwise
 */
export function compareArrays(a: Uint8Array, b: Uint8Array): boolean;

Dependencies { .dependencies }

ulid { .dependency }

Provides Crockford Base32 encoding and decoding utilities.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/ulid@3.0.x
tile.json