mirror of
https://github.com/hashicorp/vault.git
synced 2026-04-23 15:18:41 -04:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
17 lines
444 B
JavaScript
17 lines
444 B
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
/* eslint-disable no-undef */
|
|
import base64js from 'base64-js';
|
|
|
|
export function encodeString(string) {
|
|
var encoded = new TextEncoderLite('utf-8').encode(string);
|
|
return base64js.fromByteArray(encoded);
|
|
}
|
|
|
|
export function decodeString(b64String) {
|
|
var uint8array = base64js.toByteArray(b64String);
|
|
return new TextDecoderLite('utf-8').decode(uint8array);
|
|
}
|