@benev/slate
Version:
frontend web stuff
26 lines (25 loc) • 1.02 kB
TypeScript
/**
* Badge is a human-friendly presentation format for arbitrary binary data.
* - looks like "nomluc_rigpem.tg2bjNkjMh1H6M2b2EhD5V4x6XAqx9wyWddsBt"
* - the first bytes are shown in barname format
* - the rest of the data is in base58
* - designed to be a nice way to present 256-bit passport thumbprints
* - can be used for data of different lengths
* - preview size can be customized as 'leadCount', which defaults to 4
*/
export declare class Badge {
readonly bytes: Uint8Array;
readonly leadCount: number;
static readonly separator = ".";
static readonly defaultLeadCount = 4;
readonly hex: string;
readonly string: string;
readonly preview: string;
constructor(bytes: Uint8Array, leadCount?: number);
static parse(badge: string): Badge;
static fromHex(hex: string, leadCount?: number): Badge;
static string(bytes: Uint8Array, leadCount?: number): string;
static bytes(badge: string): Badge;
static hex(badge: string): string;
toString(): string;
}