function sha1(data, encoding) {
    return createHash('sha1').update(data).digest(encoding)
}
@arg {string|Buffer} data
    @arg {string} [digest = null] - 'hex', 'binary' or 'base64'
    @return {string|Buffer} - Buffer when digest is null, or string