UNPKG

react-native-quick-crypto

Version:

A fast implementation of Node's `crypto` module written in C/C++ JSI

26 lines 1.25 kB
import { Buffer as CraftzdogBuffer } from '@craftzdog/react-native-buffer'; import { Buffer as SafeBuffer } from 'safe-buffer'; import type { ABV, BinaryLikeNode, BufferLike } from './types'; /** * Converts supplied argument to an ArrayBuffer. Note this does not copy the * data so it is faster than toArrayBuffer. Not copying is important for * functions like randomFill which need to be able to write to the underlying * buffer. * @param buf * @returns ArrayBuffer */ export declare const abvToArrayBuffer: (buf: ABV) => ArrayBuffer; /** * Converts supplied argument to an ArrayBuffer. Note this copies data if the * supplied buffer has the .slice() method, so can be a bit slow. * @param buf * @returns ArrayBuffer */ export declare function toArrayBuffer(buf: CraftzdogBuffer | SafeBuffer | ArrayBufferView): ArrayBuffer; export declare function bufferLikeToArrayBuffer(buf: BufferLike): ArrayBuffer; export declare function binaryLikeToArrayBuffer(input: BinaryLikeNode, // CipherKey adds compat with node types encoding?: string): ArrayBuffer; export declare function ab2str(buf: ArrayBuffer, encoding?: string): string; export declare const kEmptyObject: any; export * from './noble'; //# sourceMappingURL=conversion.d.ts.map