Skip to content

Commit bef2e4f

Browse files
committed
document
1 parent 7474f2a commit bef2e4f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

contracts/utils/Base58.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {Bytes} from "./Bytes.sol";
88
/**
99
* @dev Provides a set of functions to operate with Base58 strings.
1010
*
11-
* Based on the original https://github.com/storyicon/base58-solidity/commit/807428e5174e61867e4c606bdb26cba58a8c5cb1[implementation of storyicon] (MIT).
11+
* Based on https://github.com/storyicon/base58-solidity/commit/807428e5174e61867e4c606bdb26cba58a8c5cb1[storyicon's implementation] (MIT).
1212
*/
1313
library Base58 {
1414
using SafeCast for bool;
@@ -17,7 +17,8 @@ library Base58 {
1717
error InvalidBase56Digit(uint8);
1818

1919
/**
20-
* @dev Base58 encoding and decoding tables
20+
* @dev Base58 encoding & decoding tables
21+
* See sections 2 of https://datatracker.ietf.org/doc/html/draft-msporny-base58-03
2122
*/
2223
bytes internal constant _TABLE = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
2324
bytes internal constant _LOOKUP_TABLE =

test/utils/Base58.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ describe('Base58', function () {
3030
);
3131
});
3232

33+
// Tests case from section 5 of the (no longer active) Base58 Encoding Scheme RFC
34+
// https://datatracker.ietf.org/doc/html/draft-msporny-base58-03
3335
describe('test vectors', function () {
3436
for (const { raw, b58 } of [
3537
{ raw: 'Hello World!', b58: '2NEpo7TZRRrLZSi2U' },

0 commit comments

Comments
 (0)