import crypto , { BinaryToTextEncoding } from 'crypto' ; export const createSHA256Hash = ( input , outputEncoding = 'hex' ) => { let data ; if ( typeof input === 'string' ) { data = Buffer . from ( input , 'utf8' ) ; } else { data = input ; } return crypto . createHash ( 'sha256' ) . update ( data ) . digest ( outputEncoding ) ; } ;