forked from trustwallet/wallet-core
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTWBase58.h
More file actions
36 lines (27 loc) · 1.02 KB
/
TWBase58.h
File metadata and controls
36 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright © 2017-2019 Trust Wallet.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
#pragma once
#include "TWBase.h"
#include "TWData.h"
#include "TWString.h"
TW_EXTERN_C_BEGIN
TW_EXPORT_STRUCT
struct TWBase58 {
uint8_t unused; // C doesn't allow zero-sized struct
};
/// Encodes data as a Base58 string, including the checksum.
TW_EXPORT_STATIC_METHOD
TWString *_Nonnull TWBase58Encode(TWData *_Nonnull data);
/// Encodes data as a Base58 string, not including the checksum.
TW_EXPORT_STATIC_METHOD
TWString *_Nonnull TWBase58EncodeNoCheck(TWData *_Nonnull data);
/// Decodes a Base58 string checking the checksum.
TW_EXPORT_STATIC_METHOD
TWData *_Nullable TWBase58Decode(TWString *_Nonnull string);
/// Decodes a Base58 string with no checksum.
TW_EXPORT_STATIC_METHOD
TWData *_Nullable TWBase58DecodeNoCheck(TWString *_Nonnull string);
TW_EXTERN_C_END