Support unicode surrogate code points

This commit is contained in:
Daniel Huigens
2018-07-30 17:02:13 +02:00
parent a2f53b2ce2
commit 00a2c0c0c2
11 changed files with 59 additions and 67 deletions

View File

@@ -143,7 +143,7 @@ S2K.prototype.write = function () {
* hashAlgorithm hash length
*/
S2K.prototype.produce_key = function (passphrase, numBytes) {
passphrase = util.str_to_Uint8Array(util.encode_utf8(passphrase));
passphrase = util.encode_utf8(passphrase);
function round(prefix, s2k) {
const algorithm = enums.write(enums.hash, s2k.algorithm);