micropython / micropython-esp32

Old port of MicroPython to the ESP32 -- new port is at https://github.com/micropython/micropython
MIT License
673 stars 216 forks source link

Fix #194 ... hash digest() can be called multiple times and on partial content #199

Closed nickzoic closed 6 years ago

nickzoic commented 6 years ago

This brings the behaviour into line with CPython 3.5 which I think is desirable enough to be worth a small performance penalty (a memcpy of ~100 bytes when calling digest)

This same technique would work with extmod/moduhashlib.c easily enough to bring the rest of the ports into alignment.

nickzoic commented 6 years ago

Now we've merged ESP32 port back to mainstream, I'd like to rejig this to apply across all ports.