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 | ;
|
15 |
|
16 | var crypto = require('crypto');
|
17 | var invariant = require('./invariant');
|
18 |
|
19 | function 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 |
|
25 | module.exports = generateHash; |
\ | No newline at end of file |