joyent/node — pull request #5403 by isaacs (2013-05-03 17:16:50+00:00)
Title: Improve crypto hash performance by optimizing string handling

1. Move all the string/byte conversion stuff into the `StringBytes` class.
2. Use a similar trick to the `StreamWrap::WriteStringImpl` into the node::crypto::Hash/Hmac/Sign/Verify classes.
3. Optimize away a needless Buffer creation in stream.Readable. (It was converting to a Buffer in some cases, then immediately converting back to a string.)

There should not be any externally visible API changes, unless someone was relying on the badly broken `node::Encode()` behavior with encodings other than BINARY or UTF8.

Review, please: @indutny @bnoordhuis @trevnorris