mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-13 19:12:18 +03:00
c7ddd679fd
### Benchmark `yarn workspace @affine/server-native bench` ``` ┌─────────┬────────────┬─────────┬────────────────────┬──────────┬─────────┐ │ (index) │ Task Name │ ops/sec │ Average Time (ns) │ Margin │ Samples │ ├─────────┼────────────┼─────────┼────────────────────┼──────────┼─────────┤ │ 0 │ 'tiktoken' │ '5' │ 176932518.76000002 │ '±4.71%' │ 100 │ │ 1 │ 'native' │ '16' │ 61041597.51000003 │ '±0.60%' │ 100 │ └─────────┴────────────┴─────────┴────────────────────┴──────────┴─────────┘ ```
21 lines
678 B
TypeScript
21 lines
678 B
TypeScript
/* auto-generated by NAPI-RS */
|
|
/* eslint-disable */
|
|
export class Tokenizer {
|
|
count(content: string, allowedSpecial?: Array<string> | undefined | null): number
|
|
}
|
|
|
|
export function fromModelName(modelName: string): Tokenizer | null
|
|
|
|
export function getMime(input: Uint8Array): string
|
|
|
|
/**
|
|
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
|
|
* result binary.
|
|
*/
|
|
export function mergeUpdatesInApplyWay(updates: Array<Buffer>): Buffer
|
|
|
|
export function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise<string>
|
|
|
|
export function verifyChallengeResponse(response: string, bits: number, resource: string): Promise<boolean>
|
|
|