15 lines
345 B
TypeScript
15 lines
345 B
TypeScript
// Copyright 2017-2023 @polkadot/util-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
/**
|
|
* @name base64Trim
|
|
* @description Trims padding characters
|
|
*/
|
|
export function base64Trim (value: string): string {
|
|
while (value.length && value[value.length - 1] === '=') {
|
|
value = value.slice(0, -1);
|
|
}
|
|
|
|
return value;
|
|
}
|