Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

SHA1 and uhashlib #178

Closed
rdagger opened this issue Sep 11, 2017 · 8 comments
Closed

SHA1 and uhashlib #178

rdagger opened this issue Sep 11, 2017 · 8 comments

Comments

@rdagger
Copy link

rdagger commented Sep 11, 2017

I tried to import uhashlib and it doesn't appear to be implemented.
I'm using the latest daily build: esp32-20170911-v1.9.2-270-g14fb53e0.bin
Is there currently any support for sha1?

@MrSurly
Copy link
Contributor

MrSurly commented Sep 11, 2017

MicroPython v1.9.2-270-g14fb53e0 on 2017-09-11; ESP32 module with ESP32
Type "help()" for more information.
>>> import binascii, hashlib
>>> hash = hashlib.sha1('mango')
>>> binascii.hexlify(hash.digest()) 
b'934aae49f648ed870c9c421829f4cece6643cf86'
>>> 

Works for me, and the hash is correct. Can you send any code that isn't working?

@rdagger
Copy link
Author

rdagger commented Sep 11, 2017

Thanks!

@MrSurly
Copy link
Contributor

MrSurly commented Sep 11, 2017

If this is resolved, please close.

@rdagger rdagger closed this as completed Sep 11, 2017
@rdagger
Copy link
Author

rdagger commented Sep 11, 2017

The issue I had was the docs refer to the library as uhashlib instead of just hashlib. Thanks again.

@MrSurly
Copy link
Contributor

MrSurly commented Sep 11, 2017 via email

@nickzoic
Copy link
Collaborator

Yeah, just rebuilt and uhashlib won't import

MicroPython v1.9.2-270-g14fb53e0 on 2017-09-12; ESP32 module with ESP32
Type "help()" for more information.
>>> import uhashlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: no module named 'uhashlib'
>>> import hashlib
>>>

It also doesn't appear in help('modules')

OK, so the new esp32-specific module was in MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS but wasn't in MICROPY_PORT_BUILTIN_MODULES, is all.

@nickzoic nickzoic reopened this Sep 12, 2017
nickzoic added a commit to nickzoic/micropython-esp32 that referenced this issue Sep 12, 2017
@MrSurly
Copy link
Contributor

MrSurly commented Sep 30, 2017

@nickzoic Is this still an issue?

nickzoic added a commit to nickzoic/micropython-esp32 that referenced this issue Oct 1, 2017
nickzoic added a commit that referenced this issue Oct 1, 2017
@nickzoic
Copy link
Collaborator

nickzoic commented Oct 1, 2017

Ok, merged #179 and closing this ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants