MCPcopy Create free account
hub / github.com/denoland/std / normalizeAlgorithm

Function normalizeAlgorithm

crypto/crypto.ts:328–335  ·  view source on GitHub ↗
(algorithm: DigestAlgorithm)

Source from the content-addressed store, hash-verified

326export type DigestAlgorithm = DigestAlgorithmName | DigestAlgorithmObject;
327
328function normalizeAlgorithm(algorithm: DigestAlgorithm) {
329 return ((typeof algorithm === "string")
330 ? { name: algorithm.toUpperCase() }
331 : {
332 ...algorithm,
333 name: algorithm.name.toUpperCase(),
334 }) as DigestAlgorithmObject;
335}
336
337function isBufferSource(obj: unknown): obj is BufferSource {
338 return obj instanceof ArrayBuffer || ArrayBuffer.isView(obj);

Callers 2

digestFunction · 0.85
digestSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected