jquery-ui/tests/runner/lib/generateHash.js
Timmy Willison 91df20be6b
Tests: replace grunt-contrib-qunit with jQuery test runner
- add filestash workflow

Close gh-2221
2024-03-29 09:13:46 -04:00

11 lines
283 B
JavaScript

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 );
}