Improve checksum documentation

Improve the wording describing the base58 checksum.
This commit is contained in:
Tobin C. Harding 2022-09-29 05:13:12 +10:00
parent 0f01cb9f51
commit 4e9ff972ad
1 changed files with 4 additions and 4 deletions

View File

@ -113,7 +113,7 @@ pub fn encode(data: &[u8]) -> String {
/// Encodes `data` as a base58 string including the checksum.
///
/// The checksum is the first 4 256-digits of the object's Bitcoin hash, concatenated onto the end.
/// The checksum is the first four bytes of the sha256d of the data, concatenated onto the end.
#[deprecated(since = "0.30.0", note = "Use base58::encode_check() instead")]
pub fn check_encode_slice(data: &[u8]) -> String {
encode_check(data)
@ -121,7 +121,7 @@ pub fn check_encode_slice(data: &[u8]) -> String {
/// Encodes `data` as a base58 string including the checksum.
///
/// The checksum is the first 4 256-digits of the object's Bitcoin hash, concatenated onto the end.
/// The checksum is the first four bytes of the sha256d of the data, concatenated onto the end.
pub fn encode_check(data: &[u8]) -> String {
let checksum = sha256d::Hash::hash(data);
encode_iter(
@ -133,7 +133,7 @@ pub fn encode_check(data: &[u8]) -> String {
/// Encodes `data` as base58, including the checksum, into a formatter.
///
/// The checksum is the first 4 256-digits of the object's Bitcoin hash, concatenated onto the end.
/// The checksum is the first four bytes of the sha256d of the data, concatenated onto the end.
#[deprecated(since = "0.30.0", note = "Use base58::encode_check_to_fmt() instead")]
pub fn check_encode_slice_to_fmt(fmt: &mut fmt::Formatter, data: &[u8]) -> fmt::Result {
encode_check_to_fmt(fmt, data)
@ -141,7 +141,7 @@ pub fn check_encode_slice_to_fmt(fmt: &mut fmt::Formatter, data: &[u8]) -> fmt::
/// Encodes a slice as base58, including the checksum, into a formatter.
///
/// The checksum is the first 4 256-digits of the object's Bitcoin hash, concatenated onto the end.
/// The checksum is the first four bytes of the sha256d of the data, concatenated onto the end.
pub fn encode_check_to_fmt(fmt: &mut fmt::Formatter, data: &[u8]) -> fmt::Result {
let checksum = sha256d::Hash::hash(data);
let iter = data.iter()