-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export = compare; | ||
/** | ||
* Can be used with Array.sort to sort and array with Uint8Array entries | ||
* | ||
* @param {Uint8Array} a | ||
* @param {Uint8Array} b | ||
* @returns {Number} | ||
*/ | ||
declare function compare(a: Uint8Array, b: Uint8Array): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export = concat; | ||
/** | ||
* Returns a new Uint8Array created by concatenating the passed ArrayLikes | ||
* | ||
* @param {Array<ArrayLike<number>>} arrays | ||
* @param {Number} length | ||
* @returns {Uint8Array} | ||
*/ | ||
declare function concat(arrays: Array<ArrayLike<number>>, length: number): Uint8Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export = equals; | ||
/** | ||
* Returns true if the two passed Uint8Arrays have the same content | ||
* | ||
* @param {Uint8Array} a | ||
* @param {Uint8Array} b | ||
* @returns {boolean} | ||
*/ | ||
declare function equals(a: Uint8Array, b: Uint8Array): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export = fromString; | ||
/** | ||
* Create a `Uint8Array` from the passed string | ||
* | ||
* Supports `utf8`, `utf-8` and any encoding supported by the multibase module. | ||
* | ||
* Also `ascii` which is similar to node's 'binary' encoding. | ||
* | ||
* @param {String} string | ||
* @param {String} [encoding=utf8] utf8, base16, base64, base64urlpad, etc | ||
* @returns {Uint8Array} | ||
* @see {@link https://www.npmjs.com/package/multibase|multibase} for supported encodings other than `utf8` | ||
*/ | ||
declare function fromString(string: string, encoding?: string): Uint8Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export declare const compare: typeof import("./compare"); | ||
export declare const concat: typeof import("./concat"); | ||
export declare const equals: typeof import("./equals"); | ||
export declare const fromString: typeof import("./from-string"); | ||
export declare const toString: typeof import("./to-string"); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export = toString; | ||
/** | ||
* Turns a `Uint8Array` into a string. | ||
* | ||
* Supports `utf8`, `utf-8` and any encoding supported by the multibase module. | ||
* | ||
* Also `ascii` which is similar to node's 'binary' encoding. | ||
* | ||
* @param {Uint8Array} array The array to turn into a string | ||
* @param {String} [encoding=utf8] The encoding to use | ||
* @returns {String} | ||
* @see {@link https://www.npmjs.com/package/multibase|multibase} for supported encodings other than `utf8` | ||
*/ | ||
declare function toString(array: Uint8Array, encoding?: string): string; |