aboutsummaryrefslogtreecommitdiffstats
path: root/tests/runner/lib/generateHash.js
blob: 66f2161d5dec2f6ec8bf7065eb4636a32221618f (plain)
1
2
3
4
5
6
7
8
9
10
import crypto from "node:crypto";

export function generateHash( string ) {
	const hash = crypto.createHash( "md5" );
	hash.update( string );

	// QUnit hashes are 8 characters long
	// We use 10 characters to be more visually distinct
	return hash.digest( "hex" ).slice( 0, 10 );
}