0.4.4 • Published 1 year ago
@kadena/cryptography-utils v0.4.4
@kadena/cryptography-utils
Collection of Kadena cryptography utility functions
Cryptography Utils
Cryptography-Utils is a collection of cryptography utility functions. This library is used by kadena.js to hash your transactions. If you have private keys available, you can also sign them with this library.
API Reference can be found here cryptography-utils.api.md
Usage Examples
import { hash, sign } from '@kadena/cryptography-utils';
import { IKeyPair } from '@kadena/types';
// Create a command
let commandPayload: string = 'Hello world!';
// Get the has of the command
let h: string = hash(commandPayload);
// Signing is normally handled by wallets, but if you have the private key
// available to you, you can also sign in this way:
let keyPair: IKeyPair = {
publicKey: 'ba54b224d1924dd98403f5c751abdd10de6cd81b0121800bf7bdbdcfaec7388d',
secretKey: '8693e641ae2bbe9ea802c736f42027b03f86afe63cae315e7169c9c496c17332',
};
let sig: string = sign(commandPayload, keyPair);Available Functions
crypto:
binToHexhexToBinbase64UrlEncodebase64UrlDecodebase64UrlEncodeArrbase64UrlDecodeArrstrToUint8Arrayuint8ArrayToStrhashhashBingenKeyPairrestoreKeyPairFromSecretKeysignsignHashverifySiguniquetoTweetNaclSecretKey
0.4.4
1 year ago
0.4.3
1 year ago
0.3.6
2 years ago
0.3.5
2 years ago
0.3.8
2 years ago
0.3.7
2 years ago
0.4.1
2 years ago
0.4.0
2 years ago
0.4.2
2 years ago
0.3.3
2 years ago
0.3.0
2 years ago
0.3.2
2 years ago
0.3.1
2 years ago
0.1.2
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago