MCPcopy Index your code
hub / github.com/tinyhttp/tinyhttp / hash

Function hash

packages/session/src/index.ts:20–31  ·  view source on GitHub ↗
(sess: any)

Source from the content-addressed store, hash-verified

18}
19
20function hash(sess: any): string {
21 // serialize
22 const str = JSON.stringify(sess, (key, val) => {
23 // ignore sess.cookie property
24 if (key === 'cookie' || key == 'store') return
25
26 return val
27 })
28
29 // hash
30 return createHash('sha1').update(str, 'utf8').digest('hex')
31}
32
33export class Cookie implements Express.SessionCookie {
34 private _expires: Date | boolean = false

Callers 5

isModifiedFunction · 0.85
isSavedFunction · 0.85
generateFunction · 0.85
inflateFunction · 0.85
saveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected