A universally-unique, lexicographically-sortable, identifier generator
78
Build a utility that converts binary data to and from a URL-safe text representation using Base32 encoding.
Your implementation should provide functionality to:
The encoded strings should be:
[72, 101, 108, 108, 111] produces the string "91JPRV3F" @test"91JPRV3F" produces a Uint8Array containing [72, 101, 108, 108, 111] @test@generates
/**
* Encodes binary data into a Base32 string
* @param input - Binary data as Uint8Array
* @returns Base32-encoded string
*/
export function encode(input: Uint8Array): string;
/**
* Decodes a Base32 string back into binary data
* @param input - Base32-encoded string
* @returns Binary data as Uint8Array
*/
export function decode(input: string): Uint8Array;Provides Base32 encoding utilities.
Install with Tessl CLI
npx tessl i tessl/npm-ulidevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10