add missing method invocation

Reviewed By: bestander

Differential Revision: D3853357

fbshipit-source-id: 0c10b4162438aa8d670522dd1fe5392eb1e6d62f
This commit is contained in:
David Aurelio 2016-09-13 03:01:11 -07:00 committed by Facebook Github Bot 6
parent 157febcd54
commit 178407da40
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,8 @@
*/
'use strict';
/* global Buffer: true */
const crypto = require('crypto');
const isUTF8 = encoding => /^utf-?8$/i.test(encoding);
@ -15,7 +17,7 @@ const isUTF8 = encoding => /^utf-?8$/i.test(encoding);
const constantFor = encoding =>
/^ascii$/i.test(encoding) ? 1 :
isUTF8(encoding) ? 2 :
/^(?:utf-?16(?:le)?|ucs-?2)$/ ? 3 : 0;
/^(?:utf-?16(?:le)?|ucs-?2)$/.test(encoding) ? 3 : 0;
module.exports = function(code, encoding) {
const hash = crypto.createHash('sha1');