import crypto from 'crypto' ; param fallback param value export function withDefault < T > ( fallback , value ) { if ( value === null || value === undefined ) return fallback ; else return value ; } param value export function sha ( value ) { return crypto . createHash ( 'sha1' ) . update ( value ) . digest ( 'hex' ) ; } param value export function base64 ( value ) { return Buffer . from ( value ) . toString ( 'base64' ) ; }