UNPKG

646 BJavaScriptView Raw
1// @generated
2/**
3 * Copyright 2013-2015, Facebook, Inc.
4 * All rights reserved.
5 *
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the root directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
9 *
10 *
11 * @fullSyntaxTransform
12 */
13
14'use strict';
15
16var crypto = require('crypto');
17var invariant = require('./invariant');
18
19function generateHash(string) {
20 var hash = crypto.createHash('sha1').update(string);
21 invariant(hash != null, 'Failed to create sha1 hash.');
22 return hash.digest('base64');
23}
24
25module.exports = generateHash;
\No newline at end of file