moduhashlib: Remove not implemented .hexdigest().

Effect can be easily achieved by ubinsacii.hexlify(hash.digest()).
This commit is contained in:
Paul Sokolovsky 2015-05-21 17:20:26 +03:00
parent 0f716aced7
commit 2fddc68fdf
1 changed files with 0 additions and 13 deletions

View File

@ -70,22 +70,9 @@ STATIC mp_obj_t hash_digest(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(hash_digest_obj, hash_digest);
STATIC mp_obj_t hash_hexdigest(mp_obj_t self_in) {
(void)self_in;
mp_not_implemented("");
#if 0
mp_obj_hash_t *self = self_in;
byte hash[SHA256_BLOCK_SIZE];
sha256_final((SHA256_CTX*)self->state, hash);
return mp_obj_new_str((char*)hash, SHA256_BLOCK_SIZE, false);
#endif
}
MP_DEFINE_CONST_FUN_OBJ_1(hash_hexdigest_obj, hash_hexdigest);
STATIC const mp_map_elem_t hash_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_update), (mp_obj_t) &hash_update_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_digest), (mp_obj_t) &hash_digest_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_hexdigest), (mp_obj_t) &hash_hexdigest_obj },
};
STATIC MP_DEFINE_CONST_DICT(hash_locals_dict, hash_locals_dict_table);