mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-23 01:24:22 +00:00
11 lines
283 B
JavaScript
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 );
|
||
|
}
|