@tanker/crypto
v4.2.0
Published
Tanker SDK (cryptographic primitives)
Downloads
13,111
Keywords
Readme
Tanker SDK (crypto)
This package is a dependency of the Tanker client SDKs for end-to-end encryption:
- @tanker/client-browser for Web applications
- @tanker/client-node for Node.js client applications
Read the documentation to get started.
Usage
Most functions in this package are synchronous, but you MUST ensure the underlying crypto library is ready before calling any of them:
import { ready, toString } from '@tanker/crypto';
const use = () => {
const bytes = [104, 101, 108, 108, 111];
const buffer = new Uint8Array(bytes);
console.log(toString(buffer)); // 'hello'
};
// Either do:
ready.then(use);
// Or:
(async () => {
await ready;
use();
})();