cc3200: Clarify notes about the extended functionality of uhashlib.

This commit is contained in:
Daniel Campora 2015-06-10 20:44:30 +02:00
parent 95cc1ff542
commit e2dc7ac2a9

View File

@ -119,6 +119,8 @@ STATIC mp_obj_t hash_read (mp_obj_t self_in) {
/******************************************************************************/
// Micro Python bindings
/// \classmethod \constructor([data[, block_size]])
/// initial data must be given if block_size wants to be passed
STATIC mp_obj_t hash_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 2, false);
mp_obj_hash_t *self = m_new0(mp_obj_hash_t, 1);
@ -136,8 +138,8 @@ STATIC mp_obj_t hash_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw
if (n_args) {
// CPython extension to avoid buffering the data before digesting it
// note: care must be taken to provide all intermidiate blocks as multiple
// of four bytes, otherwise the resulted hash will be incorrect.
// Note: care must be taken to provide all intermediate blocks as multiple
// of four bytes, otherwise the resulting hash will be incorrect.
// the final block can be of any length
if (n_args > 1) {
// block size given, we will feed the data directly into the hash engine