mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-30 01:01:00 +00:00
docs(core): improve documentation of crc32
function
[no changelog]
This commit is contained in:
parent
5c6af8332a
commit
1d747d3b7f
@ -26,9 +26,17 @@
|
|||||||
/// package: trezorcrypto.crc
|
/// package: trezorcrypto.crc
|
||||||
|
|
||||||
/// def crc32(data: bytes, crc: int = 0) -> int:
|
/// def crc32(data: bytes, crc: int = 0) -> int:
|
||||||
/// """
|
/// """
|
||||||
/// Computes a CRC32 checksum of `data`.
|
/// Computes a CRC32 checksum of `data`.
|
||||||
/// """
|
///
|
||||||
|
/// Args:
|
||||||
|
/// `data` (`bytes`): Input data.
|
||||||
|
/// `crc` (`int`, `optional`): Initial CRC value for chaining
|
||||||
|
/// computations over multiple data segments. Defaults to 0.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// `int`: Computed CRC32 checksum.
|
||||||
|
/// """
|
||||||
mp_obj_t mod_trezorcrypto_crc_crc32(size_t n_args, const mp_obj_t *args) {
|
mp_obj_t mod_trezorcrypto_crc_crc32(size_t n_args, const mp_obj_t *args) {
|
||||||
mp_buffer_info_t bufinfo = {0};
|
mp_buffer_info_t bufinfo = {0};
|
||||||
mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ);
|
mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ);
|
||||||
|
@ -3,6 +3,12 @@ from typing import *
|
|||||||
|
|
||||||
# extmod/modtrezorcrypto/modtrezorcrypto-crc.h
|
# extmod/modtrezorcrypto/modtrezorcrypto-crc.h
|
||||||
def crc32(data: bytes, crc: int = 0) -> int:
|
def crc32(data: bytes, crc: int = 0) -> int:
|
||||||
"""
|
"""
|
||||||
Computes a CRC32 checksum of `data`.
|
Computes a CRC32 checksum of `data`.
|
||||||
"""
|
Args:
|
||||||
|
`data` (`bytes`): Input data.
|
||||||
|
`crc` (`int`, `optional`): Initial CRC value for chaining
|
||||||
|
computations over multiple data segments. Defaults to 0.
|
||||||
|
Returns:
|
||||||
|
`int`: Computed CRC32 checksum.
|
||||||
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user