Variables
Const console
console: Console = ...
Const crypto
crypto: Crypto = ...
Functions
asDataView
- asDataView(a: BufferSource): DataView
Parameters
Returns DataView
flatMapOnce
- flatMapOnce<T, R>(f: (item: T) => Iterable<R> | AsyncIterable<R>, iterable: AsyncIterable<T>): AsyncIterable<R>
Type parameters
Parameters
f: (item: T) => Iterable<R> | AsyncIterable<R>
- (item: T): Iterable<R> | AsyncIterable<R>
Parameters
Returns Iterable<R> | AsyncIterable<R>
iterable: AsyncIterable<T>
Returns AsyncIterable<R>
fromHex
- fromHex(s: string): Uint8Array
Parameters
Returns Uint8Array
fromUtf8
- fromUtf8(buf: Uint8Array): string
safeIter
- safeIter<T>(iterable: AsyncIterable<T>, onError?: (err?: unknown) => void): AsyncIterableIterator<T>
Type parameters
Parameters
iterable: AsyncIterable<T>
Optional onError: (err?: unknown) => void
Returns AsyncIterableIterator<T>
sha256
- sha256(input: Uint8Array): Promise<Uint8Array>
Parameters
Returns Promise<Uint8Array>
timingSafeEqual
- timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean
Parameters
a: Uint8Array
b: Uint8Array
Returns boolean
toHex
- toHex(buf: Uint8Array): string
toUtf8
- toUtf8(s: string): Uint8Array
Parameters
Returns Uint8Array
@ndn/util
This package is part of NDNts, Named Data Networking libraries for the modern web.
This package contains general utilities used in NDNts codebase. This package cannot depend on other NDNts packages.