@azure/search-documents
Version:
Azure client library to use AI Search for node.js and browser.
18 lines • 597 B
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { stringToUint8Array, uint8ArrayToString } from "@azure/core-util";
/**
* Encodes a string in base64 format.
* @param value - The string to encode.
*/
export function encode(value) {
return uint8ArrayToString(stringToUint8Array(value, "utf-8"), "base64");
}
/**
* Decodes a base64 string into a regular string.
* @param value - The base64 string to decode.
*/
export function decode(value) {
return uint8ArrayToString(stringToUint8Array(value, "base64"), "utf-8");
}
//# sourceMappingURL=base64.js.map