Add isBase{32, 58, 64} utils (#689)

* Add isBase{32, 58, 64} utils

* Allow empty inputs

* Add base64{Trim, Pad}

* isBase64

* Update assert messages

* Cleaup ifsCompat checks
This commit is contained in:
Jaco Greeff
2020-09-20 10:05:38 +02:00
committed by GitHub
parent 301eb587cb
commit e7c665e5da
19 changed files with 121 additions and 34 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import { bs58 } from './bs58';
* @description
* From the provided input, create the base58 and return the result as a string.
*/
export default function base58Encode (value: Uint8Array | string | Buffer | number[], ipfsCompat = false): string {
export default function base58Encode (value: Uint8Array | string | Buffer | number[], ipfsCompat?: boolean): string {
const out = bs58.encode(
u8aToBuffer(u8aToU8a(value))
);