Skip to content

Commit

Permalink
docs: block comments for Base58
Browse files Browse the repository at this point in the history
  • Loading branch information
recanman committed May 9, 2024
1 parent 4eead4b commit 95d72fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Base58.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class Base58
const ENCODED_BLOCK_SIZES = [0, 2, 3, 5, 6, 7, 9, 10, 11];
const FULL_ENCODED_BLOCK_SIZE = 11;

/**
* Converts an array of unsigned 8-bit big-endian integers to a 64-bit unsigned integer.
*/
private static function uint8beTo64(array $data): string
{
$res = '0';
Expand All @@ -27,6 +30,9 @@ private static function uint8beTo64(array $data): string
return $res;
}

/**
* Encodes a block of data into Monero's Base58.
*/
private static function encodeBlock(array $data, array $res, int $res_offset): array
{
$length = count($data);
Expand All @@ -48,6 +54,9 @@ private static function encodeBlock(array $data, array $res, int $res_offset): a
return $res;
}

/**
* Encodes a hexadecimal string into Monero's Base58.
*/
public static function encode(string $hex): string
{
$data = str_split(hex2bin($hex));
Expand Down

0 comments on commit 95d72fc

Please sign in to comment.