UNPKG
eslint-plugin-rule-adoption
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.0
0.0.0-development.3
0.0.0-development.2
ESLint plugin for incremental rule adoption.
Jugbot/eslint-plugin-rule-adoption
eslint-plugin-rule-adoption
/
lib
/
utils
/
hash.js
10 lines
(7 loc)
•
237 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
crypto =
require
(
'crypto'
);
/** * sha256 hash represented in hex encoding *
@param
{
crypto.BinaryLike
}
str
*/
const
hashString
= (
str
) => crypto.
createHash
(
'sha256'
).
update
(str).
digest
(
'hex'
);
module
.
exports
= { hashString };