h2non/jshashes — pull request #26 by fish2000 (2014-05-30 07:51:22+00:00)
Title: Added raw-string methods

This `raw()` method is analogous to the `digest()` method found in Python’s `hashlib` module; it’s useful for porting algorithms from same. It returns the raw hash data using the per-ciphersuite internal `rstr()` function, encoded as UTF-8 and without applying additional encoding (á la base64).

Here’s an example, in which I used `raw()` (called on line 248) to port Django’s cryptographic string-signer to JavaScript: https://bitbucket.org/alexanderbohn/hpf/src/7c13cf8a7dc3e88837e64ce774817f1ca9896afd/instance/hamptons/static/H7/js/duckpunch.js?at=master#cl-242
… the relevant calls to `digest()` in the original Python implementation can be seen here, for the curious: https://github.com/django/django/blob/master/django/core/signing.py#L73-74