brainpicture / hashlib

lib for node which makes hashes
nodejs.ru
165 stars 35 forks source link

Suggestion: HMAC function #2

Closed davidjrice closed 14 years ago

davidjrice commented 14 years ago

Hey, I'm currently trying to put together an oauth library for JS.

I've had a lot of trouble trying to find a working HMAC-SHA1 algorithm in JS.

UNTILL I found your library! :)

Any chance you could add this function? I'll finish the OAuth and twitter library if you do!

brainpicture commented 14 years ago

I've just tried to add hmac_sha1 function! You should try it, because i have no idea, how it should work, I implemented usage: hashlib.hmac_sha1('key','message');

If it works wrong please write some usage, and result, you expect to fetch.

davidjrice commented 14 years ago

Hey, that's awesome. Can't wait to try it out.

Tried just earlier to install the library. I'm getting a few errors on the build. Trying to figure out what's causing the issue at the moment...

I'll fork & add some tests for the hmac function when it's working!

[master!hashlib ]$ make
node-waf configure build
Checking for program g++,c++             : ok /usr/bin/g++ 
Checking for program cpp                 : ok /usr/bin/cpp 
Checking for program ar                  : ok /usr/bin/ar 
Checking for program ranlib              : ok /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc,cc              : ok /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.079s)
Traceback (most recent call last):
  File "/usr/local/bin/node-waf", line 16, in <module>
    Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
    prepare_impl(t, cwd, ver, wafdir)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
    main()
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
    fun(ctx)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 385, in build
    return build_impl(bld)
  File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 395, in build_impl
    bld.load_envs()
  File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 365, in load_envs
    self.cwd = self.bldnode.abspath()
AttributeError: 'NoneType' object has no attribute 'abspath'
make: *** [all] Error 1
[master!hashlib ]$ sudo make install
Password:
cp ./build/default/hashlib.node /usr/local/lib/node/libraries/hashlib.node
cp: ./build/default/hashlib.node: No such file or directory
brainpicture commented 14 years ago

Please try to compile by: node-waf configure build and tell what OS and version do you have.

davidjrice commented 14 years ago

Yeah, that worked. Looks like it didn't do the linking correctly running 'make' . Got it installed, not sure of the output it's giving though...

Will look into it!

brainpicture commented 14 years ago

Try hmac_sha1, with the help of Adam Venturella it should work now!

brainpicture commented 14 years ago

implemented