import * as crypto from "crypto" ; import * as debugGenerator from "debug" ; import * as process from "process" ; const DEBUG = debugGenerator ( "css-blocks:caching" ) ; param identifier param significantChars returns export function gen_guid ( identifier , signifcantChars ) { let hash = crypto . createHash ( "md5" ) . update ( process . getuid ( ) . toString ( ) ) . update ( identifier ) . digest ( "hex" ) . slice ( 0 , signifcantChars ) ; DEBUG ( "guid is %s for %s" , hash , identifier ) ; return hash ; }