md5.md5(string) (#1119)

* md5.md5(string)

* switch md5 from str to AnyStr, add missing constants

* add missing import

* digest() and hexdigest() never return unicode

* make md5.md5 an alias of, and fix, hashlib_hash

* remove unnecessary import

* fix duplicate block_size

* md5.md5 and md5.new are aliases for hashlib.md5
This commit is contained in:
Matthias Kramm
2017-04-02 15:01:17 -07:00
committed by Jelle Zijlstra
parent 838d1b7436
commit 8b50522273
2 changed files with 7 additions and 10 deletions

View File

@@ -2,12 +2,14 @@
from typing import Tuple, Union
_DataType = Union[str, bytearray, buffer, memoryview]
_DataType = Union[str, unicode, bytearray, buffer, memoryview]
class _hash(object):
# This is not actually in the module namespace.
digest_size = 0
class _hash(object): # This is not actually in the module namespace.
name = ... # type: str
block_size = 0
digest_size = 0
digestsize = 0
def __init__(self, arg: _DataType = ...) -> None: ...
def update(self, arg: _DataType) -> None: ...
def digest(self) -> str: ...
def hexdigest(self) -> str: ...