Remove srcLen parameter from SHA-1 hash func

This was originally present to avoid the need to allocate a buffer
on each call to the hash func. However when we're calling the hash
func repeatedly, we'll usually use the same input length each time.
Add HMAC implementation
Add PBKDF2 implementation
Remove some duplicated code for copying buffers and converting strings to typed arrays