I have some data stored in CouchDb of the form key-value. Basically it a tuple with a value and salt. I have created a view that return these tuples and calculate the sha1() of the value + salt on the client side using javascript. Is it possible to send the sha1() hash of value + salt directly from CouchDb as JSON? I do not wish to send the salt to the client. Thanks.
I suggest a Javascript SHA1 [1] implementation directly on CouchDB. I think you have two options:
_list
function. Query speed will be (in principle) slower, since you execute code for every row for every query; but your views can remain simple.There is an SHA1 Javascript implementation in CouchDB! Point your browser to your Couch server, in /_utils/script/sha1.js
. You can copy and paste the code if you want.
[1] Or consider SHA256 or SHA512 if possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With