]> git.kaiwu.me - njs.git/commit
Nodejs style crypto methods.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 30 Mar 2018 15:50:38 +0000 (18:50 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 30 Mar 2018 15:50:38 +0000 (18:50 +0300)
commitb9ea5b5ced991afa5b73c3f1e87bea653772b57a
treea07536abdd1d255b946d48fae3df4552090fb49f
parentdafef5a9bb3893caeb34501aa1eff44ba03c3bdf
Nodejs style crypto methods.

var crypto = require('crypto')
var hash = crypto.createHash(<alg>)
    available algorithms: 'md5', 'sha1', 'sha256'.
hash.update(<data>)
hash.digest([<encoding>])
    available encodings: 'hex', 'base64'.

var hmac = crypto.createHmac(<alg>, <key>)
    available algorithms: 'md5', 'sha1', 'sha256'.
hmac.update(<data>)
hmac.digest([<encoding>])
    available encodings: 'hex', 'base64'.
17 files changed:
Makefile
njs/njs_builtin.c
njs/njs_crypto.c [new file with mode: 0644]
njs/njs_crypto.h [new file with mode: 0644]
njs/njs_object.c
njs/njs_vm.c
njs/njs_vm.h
njs/njscript.h
njs/test/njs_interactive_test.c
njs/test/njs_unit_test.c
nxt/Makefile
nxt/nxt_md5.c [new file with mode: 0644]
nxt/nxt_md5.h [new file with mode: 0644]
nxt/nxt_sha1.c [new file with mode: 0644]
nxt/nxt_sha1.h [new file with mode: 0644]
nxt/nxt_sha2.c [new file with mode: 0644]
nxt/nxt_sha2.h [new file with mode: 0644]