* Add isBase{32, 58, 64} utils
* Allow empty inputs
* Add base64{Trim, Pad}
* isBase64
* Update assert messages
* Cleaup ifsCompat checks
13 lines
292 B
TypeScript
13 lines
292 B
TypeScript
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import validate from './validate';
|
|
|
|
export default function isBase64 (value?: string | null): boolean {
|
|
try {
|
|
return validate(value);
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|