(algorithm: string)
| 18 | } |
| 19 | |
| 20 | export function getAlgorithm(algorithm: string) { |
| 21 | const algorithms: { [k: string]: string } = { |
| 22 | sha1: "SHA-1", |
| 23 | "sha-1": "SHA-1", |
| 24 | sha256: "SHA-256", |
| 25 | "sha-256": "SHA-256", |
| 26 | sha512: "SHA-512", |
| 27 | "sha-512": "SHA-512" |
| 28 | }; |
| 29 | const lowercaseAlgorithm = algorithm.toLowerCase(); |
| 30 | if (lowercaseAlgorithm in algorithms) { |
| 31 | return algorithms[lowercaseAlgorithm]; |
| 32 | } |
| 33 | return "SHA-256"; |
| 34 | } |
no outgoing calls
no test coverage detected