wampy
Version:
Amazingly fast, feature-rich, lightweight WAMP Javascript client (for browser and node.js)
28 lines (26 loc) • 770 B
TypeScript
/**
* Wampy.js Cryptosign-based Authentication plugin
*
* Copyright 2022 KSDaemon. Licensed under the MIT License.
* See @license text at http://www.opensource.org/licenses/mit-license.php
*
*/
/**
* Information required for Cryptosign signing.
*/
interface CryptosignInfo {
challenge: string;
}
/**
* Converts a hexadecimal string to an array of bytes.
*/
declare function hex2bytes(str: string): Uint8Array;
/**
* Converts an array of bytes to a hexadecimal string.
*/
declare function bytes2hex(bytes: Uint8Array): string | null;
/**
* Creates a signing function using the specified private key.
*/
declare function sign(privateKey: string): (method: string, info: CryptosignInfo) => string;
export { bytes2hex, sign as default, hex2bytes, sign };