UNPKG

@opendatalabs/vana-sdk

Version:

A TypeScript library for interacting with Vana Network smart contracts.

31 lines (30 loc) 997 B
/** * Utility functions for ECIES operations * * Provides conversion utilities between different data formats * to bridge platform-specific implementations. */ /** * Checks if two Uint8Arrays are equal in constant time * * @param a - First array to compare * @param b - Second array to compare * @returns `true` if arrays are equal */ export declare function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean; /** * Converts Buffer to Uint8Array (for Node.js compatibility layer) * In browser, this is a no-op if already Uint8Array * * @param buffer - Buffer or Uint8Array to convert * @returns Uint8Array representation */ export declare function bufferToBytes(buffer: Buffer | Uint8Array): Uint8Array; /** * Converts Uint8Array to Buffer (for Node.js compatibility layer) * Only available in Node.js environment * * @param bytes - Uint8Array to convert to Buffer * @returns Buffer representation */ export declare function bytesToBuffer(bytes: Uint8Array): Buffer;