import { Sha256 } from '../../utils/' ; export async function createLogKey ( type , optionalIdentifier ? ) { const baseKey = `kibana.history.${ type }` ; if ( ! optionalIdentifier ) { return baseKey ; } const protectedIdentifier = new Sha256 ( ) . update ( optionalIdentifier , 'utf8' ) . digest ( 'base64' ) ; return `${ baseKey }-${ protectedIdentifier }` ; }