microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/common/node/crypto.ts
12lines · modeblame
d3950d7edigeff10 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. | |
| 3 | | |
| 4 | import * as crypto from "crypto"; | |
| 5 | | |
| 6 | export class Crypto { | |
| 7 | public hash(data: string): string { | |
| 8 | const hasher = crypto.createHash("sha256"); | |
| 9 | hasher.update(data); | |
| 10 | return hasher.digest("hex"); | |
| 11 | } | |
| 12 | } |