Files
common/packages/util-crypto/src/base64/validate.spec.ts
T
Jaco 6bc648bfe0 Some tweaks on base{32, 58, 64} (#1254)
* Some tweaks on base{32, 58, 64}

* align

* rationale
2021-11-27 12:50:40 +02:00

13 lines
432 B
TypeScript

// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { base64Validate } from '.';
describe('base64Validate', (): void => {
it('validates a mixed base64 utf8 string', (): void => {
expect(
() => base64Validate('aGVsbG8gd29ybGQg0J/RgNC40LLQtd^GC0YHRgtCy0YPRjiDQvNC4IOS9oOWlvQ==')
).toThrow(/Invalid base64 character "\^" \(0x5e\) at index 30/);
});
});