f5976a2d74
* feat: moved tl-runtime to esm and native ArrayBuffers * feat: migration to esm * fix(core): web-related fixes * test: finally, some good fucking e2e * chore: fixed linters etc * ci: added e2e to ci * build(tl): fixed gen-code on node 20 * fix: codegen Uint8Array, not Buffer never `git reset --hard` kids * build: only do type-aware linting for `packages/*` * build: ignore no-unresolved in ci for e2e * fix: node 16 doesn't have subtle crypto apparently? * fix(tests): use Uint8Array for gods sake please can i just merge this already * ci: don't parallel tasks in ci because machines are utter garbage and it may just randomly break * ci: pass secrets to e2e tests * ci: separate cli command for ci apparently im retarded * fix: run codegen in e2e im actually retarded * ci: more fixes for e2e * ci: debugging stuff * ci: still debugging * ci: hopefully fix ci??? |
||
---|---|---|
.. | ||
lib | ||
src | ||
tests | ||
.gitignore | ||
binding.gyp | ||
package.json | ||
README.md | ||
tsconfig.json | ||
typedoc.js |
@mtcute/crypto-node
Native extension for NodeJS that improves performance of the most used cryptographic mode in Telegram (IGE), which is not implemented by OpenSSL.
Other modes used (i.e. CBC, CTR) and hashes are supported natively by OpenSSL, and they are faster than the custom implementation, so OpenSSL will be used for them.
Installation
You will need all the pre-requisites for node-gyp. Pre-built packages are currently not available.
Then, install the package as usual. The native library will be built automatically.
Usage
import { TelegramClient } from '@mtcute/client'
import { NodeNativeCryptoProvider } from '@mtcute/crypto-node'
const tg = new TelegramClient({
...,
crypto: () => new NodeNativeCryptoProvider()
})
Acknowledgments
Based on pyrogram/tgcrypto