MCPcopy Create free account
hub / github.com/bitwarden/clients / fromArrayToByteString

Method fromArrayToByteString

libs/common/src/platform/misc/utils.ts:215–225  ·  view source on GitHub ↗

* Converts a Uint8Array to a byte string (each byte as a character). * @param arr - The Uint8Array to convert. * @returns The byte string representation, or null if the input is null.

(arr: Uint8Array | null)

Source from the content-addressed store, hash-verified

213 * @returns The byte string representation, or null if the input is null.
214 */
215 static fromArrayToByteString(arr: Uint8Array | null): string | null {
216 if (arr == null) {
217 return null;
218 }
219
220 let byteString = "";
221 for (let i = 0; i < arr.length; i++) {
222 byteString += String.fromCharCode(arr[i]);
223 }
224 return byteString;
225 }
226
227 static fromArrayToUtf8(arr: Uint8Array): string;
228 static fromArrayToUtf8(arr: null): null;

Calls

no outgoing calls

Tested by

no test coverage detected