MCPcopy Index your code
hub / github.com/braziljs/eloquente-javascript / hash

Function hash

src/transform.mjs:12–16  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

10import {createHash} from "crypto"
11
12function hash(text) {
13 let sum = createHash("sha1")
14 sum.update(text)
15 return sum.digest("base64").slice(0, 10)
16}
17
18function startAndEnd(text) {
19 var words = text.split(/\W+/);

Callers 1

transformTokensFunction · 0.85

Calls 2

updateMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected