1/*--------------------------------------------------------------------------------------------- 2 * Copyright (c) Microsoft Corporation. All rights reserved. 3 * Licensed under the MIT License. See License.txt in the project root for license information. 4 *--------------------------------------------------------------------------------------------*/ 5import * as crypto from 'crypto'; 6 7export function computeSHA256(str: string): string { 8 const hash = crypto.createHash('sha256'); 9 hash.update(str); 10 return hash.digest('hex'); 11} 12 13