MCPcopy Create free account
hub / github.com/Effect-TS/effect / MacKeyFromBytes

Function MacKeyFromBytes

packages/effect/src/Schema.ts:14598–14607  ·  view source on GitHub ↗
(
  algorithm: A,
  options?: CryptoKeyOptions
)

Source from the content-addressed store, hash-verified

14596 * @since 4.0.0
14597 */
14598export const MacKeyFromBytes = <A extends Mac_.Algorithm>(
14599 algorithm: A,
14600 options?: CryptoKeyOptions
14601): decodeTo<MacKey<A>, Uint8Array> =>
14602 cryptoKeyFromBytes(
14603 "MacKeyFromBytes",
14604 MacKey(algorithm),
14605 (bytes) => Mac_.key(algorithm, bytes),
14606 options?.allowEncode === true ? Mac_.toBytes : undefined
14607 )
14608
14609/**
14610 * Schema that decodes a `Mac.Key` from a JWK with `KeyFormat.decodeSecret`.

Callers

nothing calls this directly

Calls 3

cryptoKeyFromBytesFunction · 0.85
MacKeyFunction · 0.70
keyMethod · 0.65

Tested by

no test coverage detected