Files
common/packages/util-crypto/src/base64/trim.ts
T
2023-01-01 10:21:43 +02:00

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;
}