MCPcopy
hub / github.com/adonisjs/core / registerHash

Method registerHash

providers/hash_provider.ts:48–53  ·  view source on GitHub ↗

* Registering the hash class to resolve an instance with the * default hasher. * * Creates a singleton binding for the Hash class that resolves * the default hasher from the hash manager. * * @example * const hash = await container.make(Hash) * const hashed = await hash.make(

()

Source from the content-addressed store, hash-verified

46 * const hashed = await hash.make('password')
47 */
48 protected registerHash() {
49 this.app.container.singleton(Hash, async (resolver) => {
50 const hashManager = await resolver.make('hash')
51 return hashManager.use()
52 })
53 }
54
55 /**
56 * Registers the hash manager with the container

Callers 1

registerMethod · 0.95

Calls 1

makeMethod · 0.80

Tested by

no test coverage detected