Map reduce - need to use sha1 javascript function


While writing Map Reduce in Couchbase, I have encountered an issue that while emitting key,value from MAP function has very long key and hence i want to convert the key to unique hash using SHA1 function. I do know that couchbase internally uses sha1 JS libraries but somehow I am not able to import and use it in my code. Any help will be greatly appreciated.


You can implement your sha1 in javascript and put into the map function body. I have and example here: