import * as crypto from "crypto" ; export namespace randomUtils { export function getRandomHexString ( length ) { const buffer = crypto . randomBytes ( Math . ceil ( length / 2 ) ) ; return buffer . toString ( 'hex' ) . slice ( 0 , length ) ; } export function getPseudononymousStringHash ( s ) { return crypto . createHash ( 'sha256' ) . update ( s ) . digest ( 'base64' ) ; } }